Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Running applescripts in a macOS app

One of the functionality in my macOS app needs to run an applescript. The required script file is in the app bundle. On first run, the user is prompted to select the "ApplicationScripts" folder so that the app copies the script file from bundle and to the App Scripts folder. From there on the app can run the script, upon user action.

The app was rejected quoting review quidelines -

2.4.5(ii) - Your app requires or is designed to work with helper scripts which is an optional install.

2.4.5(viii) - Your app installs code in shared locations. Specifically, the app installs helper scripts.

I don't clearly understand the reson for rejection and also is there a prover way to run scripts without violating review guidelines?

Adding scripting support via NSUserScriptTask is tricky because such scripts will let the app trivially escape its sandbox. Given that, App Review looks very carefully at how apps use this feature. I don’t work for App Review and thus can’t give you definitive answers about their policy, but my understanding is that they want this feature to be user as a general-purpose scripting mechanism, not just as a way to do things that would otherwise be blocked by the sandbox.

For example, consider a backup application. At the end of the backup the user might want to shut down the Mac. There’s no way to initiate a shut down from within the sandbox, so you could use a script for this. Having a hard-wired shutdown script is likely to cause problems with App Review. However, you’re likely to have more luck with a general-purpose “after the backup, run this script” feature, and then the user can write their own script that shuts down the Mac.

IMPORTANT The ultimate arbiter of what will or won’t be allowed on the store is App Review. I don’t work for App Review and can’t make definitive statements on their behalf. The above is a general guideline that may or may not be helpful in your specific context. For definitive answers you will have to contact them directly.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"

Running applescripts in a macOS app
 
 
Q