Re: Quitting a Stay-open Application
Re: Quitting a Stay-open Application
- Subject: Re: Quitting a Stay-open Application
- From: Marc Myers <email@hidden>
- Date: Sun, 20 May 2007 21:35:18 -0600
On May 20, 2007, at 1:00 PM, Luther Fuller wrote:
From: Luther Fuller <email@hidden>
Subject: Quitting a Stay-open Application
To: Applescript Users <email@hidden>
I've written this simple script which is compiled as a stay-open,
show-in-dock application bundle.
on idle
tell application "Finder"
set prevCount to count windows
repeat
set winCount to count windows
if winCount = prevCount + 1 then
activate
beep
end if
set prevCount to winCount
delay 1
end repeat
end tell
return 1
end idle
on quit
display dialog "Quitting ..."
continue quit
end quit
Choosing Quit from the Dock menu has no effect ... I have to Force
Quit from the Dock to get the application to actually quit.
If I make the this application frontmost, then choose Quit ... from
the application menu, I do get the "Quitting ..." dialog. I can
repeat this provided I click the "Cancel" button. If I click the "OK"
button, the application continues to run and I can no longer get
Quitting ..." dialog.
The only documentation I can find on this is
"AppleScriptLanguageGuide.pdf", but this is an ancient document. (It
says that the application should quit.)
The 'continue quit' command seems to be broken. Does anyone know more
about this?
I've found that this works as advertised:
on run
display dialog "Running..."
end run
on idle
tell me to activate
display dialog "Idling..."
return 15
end idle
on quit
tell me to activate
display dialog "Quitting..."
continue quit
end quit
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden