Re: Scripts folder for applications
Re: Scripts folder for applications
- Subject: Re: Scripts folder for applications
- From: Shane Stanley <email@hidden>
- Date: Thu, 13 Dec 2012 14:48:33 +1100
On 13/12/2012, at 8:45 AM, Shane Stanley <email@hidden> wrote:
> The new location was only introduced in OS X 10.8, and is designed for Scripts menus (or panels) that belong to sandboxed apps.
To elaborate on this a bit more... There's an Apple PDF that documents how AppleScript behaves under the new sandboxing regime, but which appears to have been inadvertently not made public when Mountain Lion was released. If you have a developer account, you can read it at developer.apple.com, and it will also be re-posted publicly within a day or so. Meanwhile here's the relevant bit:
--------
Non-Hosted Scripts
AppleScript scripts run from within the AppleScript Editor application, or launched from the system-wide Script Menu utility, or saved as applets/droplets, should execute on the host computer with NO RESTRICTIONS.
Internal Application Scripts
AppleScript scripts executed internally by an application will be restricted IF the scripts target applications other than the host application or applications for which the hosting application has sandbox entitlements. Scripts executed internally by an application inherit the sandbox privileges/restrictions of the executing application.
Application-Hosted Scripts (application script menus)
To be sandbox-compliant, applications hosting a script menu will be required to adhere to the following procedures:
1. Scripts displayed by the application script menu must be located within the applicationʼs designated directory in the applications script folder (new in OS X v10.8): Home > Library > Application Scripts > com.developer.appID. By default, applications will not have write-permissions to the designated scripts folder. Scripts must be placed in that directory by the user or user-approved installer.
2. Accessing the list of scripts to display in the application script menu will be done through existing APIs.
3. The execution of scripts chosen by the user from the application script menu will be done through provided APIs.
4. The scripts executed using the provided APIs do not inherit the sandbox permissions/restrictions of the hosting application, and will run with no restrictions.
Application Event-Handler Scripts
Some applications, such as iChat, Aperture, and Mail, provide the ability to run user-chosen AppleScript scripts when a specified event occurs. Mail rules in Mail, or import actions in Aperture, are two examples. To be sandbox-compliant, applications running scripts as event handlers, will be required to adhere to the following procedures:
1. Scripts used as event handlers menu must be located within the applicationʼs designated directory in the applications script folder: Home > Library > Application Scripts > com.developer.appID. By default, applications will not have write-permissions to the designated scripts folder. Scripts must be placed in that directory by the user or user-approved installer.
2. Accessing the list of scripts to display to the user for choosing an event handler script will be done through existing APIs.
3. The execution of scripts chosen by the user to perform the handling of an event will be done through provided APIs.
4. The scripts executed using the provided APIs do not inherit the sandbox permissions/restrictions of the hosting application, and will run with no restrictions.
Embedded AppleScript Code
AppleScript code, in text form, placed within documents or databases, may be RESTRICTED from execution IF the AppleScript code targets applications other than the host application or applications for which the hosting application has sandbox entitlements.
--------
--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
_______________________________________________
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