Multi-purpose Quit handler
Multi-purpose Quit handler
- Subject: Multi-purpose Quit handler
- From: pete boardman <email@hidden>
- Date: Sat, 22 Oct 2005 11:06:03 +0100
I'm trying to write a script that I can run as a multi-purpose Quit
handler. I can run it using a system-wide keyboard shortcut, and it
will do auxiliary tasks depending on which application I'm quitting
from.
--
tell application "System Events"
set fap to first application process whose frontmost is true
activate
display dialog "Are you sure you want to quit " & name of fap &
"?" buttons {"Yes", "No"} default button "Yes"
end tell
if button returned of result is "Yes" then
tell fap to quit saving ask
end if
--
It often goes wrong, with a:
System Events got an error:
NSReceiversCantHandleCommandScriptError
I think I can see the problems (trying to quit the process running
the script?) but can't solve it.
Pete
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden