Hi All,
I'm trying to make an app that will display a prompt upon shutdown asking if the user has logged their hours via our online system 'timely'. The idea is that the reminder appears 'Have you logged your timely hours?' with the options 'yes' or 'no'. 'Yes' allowing the machine to shut down and 'No' opening Google Chrome on the Timely website.
So far using the following script the alert is popping up, but when I select 'No' the machine is still shutting down. Can anyone help?
say "Aye up! I'll be reminding you to log your hours on timely when you shut down. "
on quit
set the alert_message to "Have you logged your hours on Timely?"
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 "Google Chrome"
open location "app.timelyapp.com"
end tell
end if
continue quit
end quit
I'm trying to make an app that will display a prompt upon shutdown asking if the user has logged their hours via our online system 'timely'. The idea is that the reminder appears 'Have you logged your timely hours?' with the options 'yes' or 'no'. 'Yes' allowing the machine to shut down and 'No' opening Google Chrome on the Timely website.
So far using the following script the alert is popping up, but when I select 'No' the machine is still shutting down. Can anyone help?
say "Aye up! I'll be reminding you to log your hours on timely when you shut down. "
on quit
set the alert_message to "Have you logged your hours on Timely?"
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 "Google Chrome"
open location "app.timelyapp.com"
end tell
end if
continue quit
end quit