Squrler
Squrler

Reputation: 3514

Running an Applescript after build phase in Xcode

I have an Applescript that opens the Safari developer tools. This saves me from the hassle of clicking Develop -> Inspect -> index.html every time I build a Cordova / Phonegap app.

I would now like to invoke this Applescript when I build the project and open it in the simulator.

I've tried adding a building phase and adding the script as instructed in https://developer.apple.com/library/ios/recipes/xcode_help-project_editor/Articles/AddingaRunScriptBuildPhase.html.

However when I build the project in XCode I'm getting an error: "auto_opendevtools.applescript: bad interpreter: Permission denied". Seems all the permissions are fine.

How I entered the script in the build phase:

enter image description here

Leads to error:

enter image description here

Upvotes: 0

Views: 1049

Answers (1)

jackjr300
jackjr300

Reputation: 7191

The "Add Run Script Build Phase" need a shell command or a path of the shell script.

To run an AppleScript from a shell script, you must use the osascript command.

osascript "/the path of/auto_opendevtools.applescript"

Upvotes: 6

Related Questions