Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running straight through, like a normal Applescript



You can use the Application's Event Handlers (as to specify in Interface Builder's Info Pane)

e.g.
- an "will finish launching" event handler
- an "launched" event handler
- an "will quit" event handler

In the "will finish launching" event handler you register and read your defaults.
In the "launched" event handler you specify all the actions you want to do and at the end use:
quit me
Then you can write the needed defaults in the "will quit" event handler

Hope this helps,
Jasper.


On Apr 26, 2005, at 9:57 AM, Derrick Bass wrote:

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?


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Running straight through, like a normal Applescript (From: Derrick Bass <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.