2

I wrote an applescript that makes use of an external command line script that helps to perform clicks.

Now, if I want to publish my script, what should be my approach to the end users? I mean, should I say to them: "first of all you have to download this CLI utiltity, and put in this folder... then download and run my script!"

This is a newbie question but: is this the only way to do this? or can I include in some way the CLI code in my script/package? If yes how?

1 Answer 1

6

If the script is short enough, you can include it in the AppleScript directly:

do shell script "if [ -f /tmp/foo ]; then rm /tmp/foo; fi"

If it's long and/or complex enough that that's unwieldy, you can embed it in the application bundle (I think in the Contents/MacOS subfolder would be the best place), and then execute it from AppleScript like this:

set objectFolder to (path to me) as string
do shell script ((quoted form of POSIX path of (objectFolder)) ¬
    & "Contents/MacOS/scriptname")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.