I want to write an application that behaves like a normal Applescript:
running straight through from beginning to end (possibly with dialog
boxes along the way) and then quitting when done. (I can't just use an
Applescript, because I need user defaults and pretty complicated dialog
boxes and a few other advanced features that are available only in
AppleScript Studio apps.)
What's the best way to do this?
I tried just running the script from main(), but the app spewed errors
whenever I tried anything more than the usual AppleScript stuff. (For
example, when I tried to use "user defaults".) I presume there's some
initialization that happens when I call NSApplicationMain() that I'm
not getting. I'm also concerned that without an event loop, my dialogs
might not work correctly (I haven't tried throwing up a dialog box from
the nib yet). So should I call NSApplicationMain()? Then how do I get
run-straight-though-and-quit behavior?