No. A statement like run application “MyApplet” is all that’s need (provided it is indeed saved as an Application).
Script Editor Example (which i have tested):
Create a new window with this code:
tell me to activate
display dialog "My path is: " & (path to me as string)
and save as an application called “Quark”. You may close this window if you like; doesn’t matter.
Now create a new window with this code:
try
run application "Quark"
end try
It calls the applet Quark, which displays a dialog with the path to itself. (Notice that if you execute Quark directly from the Script Editor, you get a different result: You get a path to the Script Editor.)
Well, you’re not re-launching; merely calling its run handler again, so it always should work. In Script Editor, if you save Quark as “stay open,” the example above still works, whether or not the application Quark is already running. However there are some nuances which may be coming into play here.
Some depend on whether or not the application is “stay open” or not, whether the application is running or not, etc. That’s why the “try” block is there in my example. I’m a bit rusty on all the details, but for the most part it has to do with Open vs Run handlers, and related issues. Something about when you run an app, there’s an implicit open, and so the code can get executed twice, or something like that.
I don’t recall the exact syntax offhand, but you should be able to call a named handler within the Applet to avoid some of these issues (by leaving the open and run handlers empty). But i don’t recall offhand how to form the call to a named script within an Applet like that, so that’s a whole other can of worms, and one that i’m not eager to open up.
AppleScript Studio makes it easy to call a named function, however, as i think it creates an AppleScript Dictionary for all named functions within the App. Have i said i think AppleScript Studio is the way to go on this project?
Okay, so you can get along without it too, i suspect.