Shutdown Applescript Issue
Hi All,
I have an applescript that worked perfectly until 10.7 brought in application state when shutting down. Now my script shuts down the mac, but when i turn it back on i am prompted with the dialog to add the shut down time again. This is a pain as i have to force quit it. Has anyone got any ideas on how to not retain application state (open) when shutting down?
any help is greatly appreciated.
property shutdown_time : date
on run
set response to display dialog "Please State Number of minutes until Shutdown?" with title "LockDown V2.0" buttons {"LockDown!"} default answer "60" with icon path to resource "Time.icns" in bundle ("/Users/jbird/Documents/MAC Apps/Created Mac Apps")
set timer to (text returned of the response) as number
set shutdown_time to (current date) + (timer * minutes)
end run
on idle
if (shutdown_time < (current date)) then
tell application "System Events"
ignoring application responses
shut down
end ignoring
end tell
quit
end if
return 1
end idle