You are not logged in.
What is correct way to run AppleScript from another AppleScript?
There is atleast run, launch and open and this confuses me.
Offline
Applescript:
do shell script "osascript -e 'say \"Hello\"'"
![]()
There is no "correct" way, I think. You select what you're comfortable with, or what is fastest.
A matter of style, so to speak.
That's assuming the end result is the same for each command - which may not be the case.
I never had need to figure that out.
Last edited by alastor933 (2012-12-07 06:53:43 am)
Offline
Thanks, but i mean launch AppleScript application. For instance:
Applescript:
tell application "testing" to run
Offline
Applescript:
tell application "testing" to run
Makes it come to the foreground.
Applescript:
tell application "testing" to launch
Starts it up in the background, ready to take requests.
You can also tell it to open in the background with the open -g command, if you have set CFBundleSignature in the plist.file of your applet. You can also open it directly with a open -a command within a do shell script.
Type man open in a Terminal window.
Offline
Launch does not send the run command. Open behaves more or less as run.
Offline
I wrote:
Applescript:
Open this Scriplet in your Editor:
tell application "testing" to launch
Starts it up in the background, ready to take requests.
I really meant that it wasn't full launched, but ready to run. It is per definition, started up, it just hasn't run yet.
Activate, I think, is like an implicit run.
And the fun part, is that if you have handlers indside your app, then you can call those within a tell block of the app, and pass it messages. ![]()
Last edited by McUsrII (2012-12-07 07:42:16 am)
Offline