Applescript to run at shut down
I am trying to make an application using AppleScript which can remind to check my mails, if I forget to check, at shutdown.
I took help from this link: http://discussions.apple.com/thread.jspa?threadID=1375949&tstart=0&messageID=7088687#7088687
In this link they have suggested that I can run a quite application which can be start开发者_Python百科ed at login and when I will try to shut down, system will try to close it and desired result will be obtained!
I have tried this script code:
say "Good morning Miraaj! I will be reminding you to check your mails at shutdown. Have a rocking day!!"
on quit
set the alert_message to "Have you checked your mails?"
display dialog the alert_message buttons {"Yes", "No"} default button 1
set the my_choice to the button returned of the result
if my_choice is "Yes" then
tell application "Finder"
shut down
end tell
else
tell application "Safari"
open location "www.gmail.com"
end tell
end if
continue quit
end quit
but it is not working for me!
Can anyone suggest where I may be wrong ??
thanks,
Miraaj
it is working now when I saved it as stay open application! :)
精彩评论