Reputation: 1613
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?
Upvotes: 2
Views: 732
Reputation: 125718
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")
Upvotes: 6