Re: Prematurely quitting script?
Re: Prematurely quitting script?
- Subject: Re: Prematurely quitting script?
- From: Emmanuel <email@hidden>
- Date: Mon, 8 Dec 2003 20:08:00 +0100
At 1:39 PM -0500 08/12/03, Mike Zornek wrote:
>
tell application "Finder"
>
if (exists disk iPodName) then
>
display dialog "I found it!" buttons {"OK"} default button "OK"
>
else
>
display dialog iPodName & " was not found. Please connect it and
>
relaunch script." buttons {"Quit"} default button "Quit"
>
end if
>
end tell
>
>
I'd like to add some kind of command that would quit this script after the
>
warning about how it couldn't find the iPod. How would I do this? If I use
>
"quit" it seems to quit the Finder.
If you saved your script as an application, not checking a "stay-open" option, the application should quit when your script terminates (to terminate a script, use the "return" command, but as you show it your script will return by itself when the user clicks "Quit").
Regarding the "quit Finder" matter: if you write "quit" in your application (can make sense, for instance in a stay-open application), just leave it outside the "tell finder" (and any "tell whoever") wrapper otherwise you're telling Finder to quit.
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.