<<AppleScript>>
set question to display
dialog "The machine has not been shut down or restarted for
more than a week. Please shut down or restart the machine by clicking on Shut
Down or Restart." with title "System Event by
Andres Cheah, MCM" with icon stop
buttons {"Shut Down", "Restart",
"Cancel"}
set answer to button returned of question
if answer is equal to "Shut
Down" then
tell application "System
Events"
shut down
end tell
end if
if answer is equal to
"Restart" then
tell application "System
Events"
restart
end tell
end if
if answer is equal to
"Cancel" then
return
end if
No comments:
Post a Comment