send/receive apple events from external object
I'm working on an external that can send/receive apple events. All is fine, accept that I can't get Max to ask macos to allow sending the events. In other words: I need to create an entrance in system preferences -> security & privacy -> automation tab. I would normally do this by adding the key "Privacy - AppleEvents Sending Usage Description" in the info.plist of my application to get a system prompt asking the user to allow this or not. But adding this key to the info.plist of my external doesn't do the trick.
I was able to get it working some years ago on my old machine. But now on the new one I tried everything without success. Anybody knows how to do this?
@11olsen - thanks, this works for the accessibility tab, but not for _automation_.
There isn't even a way to add entrances manually into this tab - these can only be done by the system itself (approved by the user).
I also tried to define and use 'entitlements' but without success.
Everything's working fine in a command line tool, running basically the same code.
btw, this is on macos 12.1
Isn't this part of OSX security that you can't insert new entries without user approvement? Maybe someone else knows more. I'm a Windows user..
yes, exactly and this is why I need Max to ask for permission for automation, so the user can allow it.
But running my code in a max external, I can't get the system dialog and all apple events fail silently.
It seems with every new OSX version it becomes harder to access anything outside of your app. OSX owns your computer. Your app is the sandbox you're allowed to play in.
at the end he's adding a second key to the plist
it's already in there :*/
Hi Volker, I was having problems with permissions in a standalone and was advised to downgrade max to 8.1.11 - that solved it for me. It was a bug. Not sure if this has been fixed in the newest release.
Thanks for the hint, but unfortunately this doesn't seem to change anything here.
Hi Volker, I ticketed this request for further review. I'll let you know if there's anything we can do here.
If this is for private use, a temporary solution would be to grant
Max automation access using tccplus
https://github.com/jslegendre/tccplus
but SIP needs to be disabled
@ROB - thanks, that's great. Please let me know if I can help with any additional info.
@SOURCE - I quickly dabbled with this, but it didn't solve the problem. While I can grant permissions to Max to send appleevents, I didn't find a way to set permissions for controlling a specific target app. Might be just me, not knowing how to use the tool correctly, though.
Anyway, I would have been happy to just try it out locally. But in the end, the results might be interesting for others, too. I'm trying to resurrect the old [s2m.wacom], as I need to get tablet interaction back on my new machine.
Hi Volker, I realized I never followed up on this. Since 8.3 Max shipped with an updated entitlements that should allow apple events. Please let us know if this is working as expected now (signing and notarizing will likely be required).
Hello Rob - thanks for getting back to me!
In my particular case, I was able to solve the issue with a call to :
OSStatus AEDeterminePermissionToAutomateTarget(...);
This brings up the 'allow AppleEvents'-prompt when used for the first time. Exactly what I was missing before. Here's some more info about it:
https://www.felix-schwarz.org/blog/2018/08/new-apple-event-apis-in-macos-mojave
Anyone interested in the resurrected [s2m.wacom] object for which I needed this, there's more info in this thread:
https://cycling74.com/forums/wacom-tablet-pen-pressure
Haven't tried the updated entitlements in Max8.3, but since this requires signing and notarization as you say, I won't be able to use it at this point anyway.