Re: Using applescript on Mavericks within Java complaning it is a sanboxed application but it is not
Re: Using applescript on Mavericks within Java complaning it is a sanboxed application but it is not
- Subject: Re: Using applescript on Mavericks within Java complaning it is a sanboxed application but it is not
- From: Christopher Nebel <email@hidden>
- Date: Tue, 05 Nov 2013 10:55:56 -0800
On Oct 24, 2013, at 7:00 AM, Paul Taylor <email@hidden> wrote:
> Using applescript within Java complaining it is a sandboxed application but it is not, although it is signed application, (not an applet but a standalone java applicatioon)
>
> 10/20/13 12:37:44.553 PM iTunes[74256]: AppleEvents/sandbox: Returning errAEPrivilegeError/-10004 and denying dispatch of event rdwr/writ from process 'Jaikoz'/0x0-0x413413, pid=19717, because it is not entitled to send an AppleEvent to this process.
>
> I call the javascript by using java ScriptEngine
>
> ScriptEngineManager mgr = new ScriptEngineManager();
> ScriptEngine engine = mgr.getEngineByName("AppleScript");
>
> How can I resolve this
The error is actually normal, but it's being logged incorrectly. You put a "write" command inside a 'tell application "iTunes"' block, which sends the event to iTunes. However, security rules in place since Snow Leopard prevent iTunes from handling it; it reports an error, which AppleScript notices and uses to re-handle the event inside your application. Unfortunately, the "iTunes reports an error" bit uses the same error code used for sandbox rejections, and AEM logs it as such. So, you are seeing a bug, but it's essentially harmless. If you want to get rid of the extra event send (and the resulting log), move the "write" command outside of any "tell" block, or prefix it with "tell current application to", as described in <https://developer.apple.com/library/mac/releasenotes/AppleScript/RN-AppleScript/RN-10_6/RN-10_6.html> under "Scripting Addition Security".
--Chris Nebel
AppleScript Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden