Jump to content

AppleScript from another macOS application


Recommended Posts

Hey Brand New User here!

I'm a macOS developer who is trying to support Evernote into my macOS application - Kudos.

I want to send some simple AppleScript to Evernote from within my application.

I've written and tested the AppleScript with Script Editor.  Working just fine (BTW Catalina; Xcode 11.4; Evernote 7.14 Basic)

My app is sold through the Mac App Store, therefore I must utilize the privacy controls within Catalina.

macOS provides this function:

OSStatus AEDeterminePermissionToAutomateTarget( const AEAddressDesc* target, AEEventClass theAEEventClass, AEEventID theAEEventID, Boolean askUserIfNeeded );

When I execute this function against Evernote I get 'errAEEventNotPermitted'.

Is this because I have 'Basic'?

Do I need an API Key just to run AppleScript from inside an application?

Anybody have a useful viewpoint?

Steve

 

Link to post
  • Level 5*
16 hours ago, SteveC_OR said:

I'm a macOS developer who is trying to support Evernote into my macOS application - Kudos.

I want to send some simple AppleScript to Evernote from within my application.

I've written and tested the AppleScript with Script Editor.  Working just fine (BTW Catalina; Xcode 11.4; Evernote 7.14 Basic)

My app is sold through the Mac App Store, therefore I must utilize the privacy controls within Catalina

You will probably find better support for AppleScript developer questions at AppleScript for Developers topics - Script Debugger Forum .

I can tell you this:

  1. Accessing Evernote via AppleScript does NOT require any use of the Evernote API.
  2. Catalina presents new challenges for all apps, especially those that want to interact with other apps.
  3. Selling an app through the Apple Mac Store presents additional restrictions and challenges.  Many developers have opted to sell directly from their own web site to avoid these issues.

Good luck.

Link to post

I found the answer...  

I am now using the 'hardened runtime' as a cornerstone for my app.  When using this technology it is necessary to add an additional entitlement 'com.apple.security.automation.apple-events'

Once this entitlement was included then the responses to 'AEDeterminePermissionToAutomateTarget' were as expected!

Whew!

Steve

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...