Correct way to open AppleScript?

What is correct way to run AppleScript from another AppleScript?

There is atleast run, launch and open and this confuses me.

do shell script "osascript -e 'say \"Hello\"'"

:lol:

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.

Thanks, but i mean launch AppleScript application. For instance:

tell application "testing" to run
tell application "testing" to run

Makes it come to the foreground.

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.

Launch does not send the run command. Open behaves more or less as run.

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. :slight_smile: