Slogger icon indicating copy to clipboard operation
Slogger copied to clipboard

AppleEvents/sandbox: Returning errAEPrivilegeError/-10004

Open mrjcleaver opened this issue 10 years ago • 1 comments

Console says:

2015-02-04 10:16:03.636 AM Timing[793]: AppleEvents/sandbox: Returning errAEPrivilegeError/-10004 and denying dispatch of event misc/curd from process 'osascript'/0x0-0x1e31e3, pid=6833, because it is not entitled to send an AppleEvent to this process.

I call osascript from a plugin. If I run it from the plist (installed by install.rb; editable from LaunchControl http://www.soma-zone.com/LaunchControl/) then I get the above error.

If I run by hand, it works fine.

Some research:

http://www.macworld.com/article/1165641/how_increased_mac_security_measures_will_impact_applescript.html

if you run a script “by hand”—whether from AppleScript Editor, from within Automator, or as a standalone app or droplet—it should be able to do whatever it’s scripted to do, just as it can today.

If, however, a sandboxed app wants to use AppleScript to interact with another app or with other parts of your system—a menubar app that uses AppleScripts to control iTunes, say—then the new restrictions will come into play. A sandboxed app can’t use AppleScript to communicate with another app on your Mac, unless the developer specifically requests (and receives) an entitlement to do just that.

Some links:

  • http://superuser.com/questions/270223/use-launchctl-to-fire-an-applescript-script-periodically/873587#873587
  • http://lists.apple.com/archives/java-dev/2013/Oct/msg00027.html
  • https://groups.yahoo.com/neo/groups/isramac/conversations/topics/18339
  • http://superuser.com/questions/499972/pass-arguments-to-osascript-via-shell-function-in-os-x-mountain-lion 9:43 AM

Has anyone seen an issue like this with Slogger? It looks like I'd have to convert the applescript into an app and then use code sign tool but I wonder why this is necessary for me but not for the main code.

I already enabled System Preferences > Security & Privacy > Accessibility > AppleScript Editor.app

Thanks, M.

mrjcleaver avatar Feb 04 '15 15:02 mrjcleaver

I would try running the launchd process as root. I know that's possible with a LaunchDaemon using the User key, but not certain about LaunchAgents. http://launchd.info/

On 4 Feb 2015, at 9:44, Martin Cleaver wrote:

Returning errAEPrivilegeError/-10004 and denying dispatch of event 
misc/curd from process 'osascript'/0x0-0x1e31e3, pid=6833, because it 
is not entitled to send an AppleEvent to this process.

```

I call osascript from a plugin. If I run it from the plist (installed 
by install.rb; editable from LaunchControl 
http://www.soma-zone.com/LaunchControl/) then I get the above error.

If I run by hand, it works fine.

Some research:

http://www.macworld.com/article/1165641/how_increased_mac_security_measures_will_impact_applescript.html

> if you run a script “by hand”—whether from AppleScript Editor, 
> from within Automator, or as a standalone app or droplet—it should 
> be able to do whatever it’s scripted to do, just as it can today.

> If, however, a sandboxed app wants to use AppleScript to interact 
> with another app or with other parts of your system—a menubar app 
> that uses AppleScripts to control iTunes, say—then the new 
> restrictions will come into play. A sandboxed app can’t use 
> AppleScript to communicate with another app on your Mac, unless the 
> developer specifically requests (and receives) an entitlement to do 
> just that.

Some links:
* 
http://superuser.com/questions/270223/use-launchctl-to-fire-an-applescript-script-periodically/873587#873587
* http://lists.apple.com/archives/java-dev/2013/Oct/msg00027.html
* 
https://groups.yahoo.com/neo/groups/isramac/conversations/topics/18339
* 
http://superuser.com/questions/499972/pass-arguments-to-osascript-via-shell-function-in-os-x-mountain-lion 
9:43 AM

Has anyone seen an issue like this with Slogger? It looks like I'd 
have to convert the applescript into an app and then use code sign 
tool but I wonder why this is necessary for me but not for the main 
code.

I already enabled System Preferences > Security & Privacy > 
Accessibility > AppleScript Editor.app

Thanks,
M.

---
Reply to this email directly or view it on GitHub:
https://github.com/ttscoff/Slogger/issues/354
```

ttscoff avatar Feb 04 '15 15:02 ttscoff