English 中文(简体)
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 started 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! :)

问题回答

暂无回答




相关问题
How can I get the Windows last reboot reason

I d like to know what is the Windows API function (if any exists) that provides information about the last Windows reboot source. There are three main possible causes: The computer crashed on a blue ...

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?...

Shutdown a computer from AIR/Flex

I need to figure out how to shut down the computer from an Adobe AIR application. I have been trying to figure out how to do this, and without success.

The OS doesn t shutdown, but my application does

I have an application which when I close the Windows, it exits gracefully and quickly (checked also in Task Manager and Process Explorer - the process isn t there anymore) but the OS doesn t. It seems ...

How to bring a system out of standby programatically?

Is there a way to do it in c# or vb.net? I have to bring a system out of standby and play a notification sound if it is in standby mode, at specific time intervals. Is this possible?

How to Safely Force Shutdown of Mac

What I want I m developing a little app to force me to only work at certain times of day - I need something to force me to stop working in the evenings so I can be more effective in the day. The ...

热门标签