Hi, I have a very simple AppleScript that presents a reminder on screen every 20 minutes along with a 'yes' and 'no' button. Click 'yes' and the message reappears in 20 minutes, click 'no' and the script exits.
If I manually open the script it works perfectly. But I'd like to have it automatically launch at startup so I saved it as an application and marked it to open at login. It opens at login but after clicking 'yes' the message disappears as it should, but a spinning black and white beachball stays on screen and the application remains open as the ball spins. I have to click on something else to put the application into the background (where it remains open in the dock). If I want to quit the application at this point I'm unable to except through a force quit (or I can wait 20 minutes for the next reminder message and click the 'no' button so the script exits).
I'm wondering:
1) If I keep this application, is it possible to not have the spinning black and white beachball after I click the message's 'yes' button, and just have the application automatically recede to the background/dock?
2) Would I be better off just launching it as a script at startup and not doing it as an application? If so, what's the easiest way to do that, as I've never used Launchd, launchdaemons, or any of that stuff before, but could certainly give it a try.
3) Is there a way to get the reminder message to stay in the foreground (on top of everything else) when it appears? Right now if I have a document or browser open and am clicking something at the moment the message appears, the message gets hidden underneath.
Thanks for any help!
Here's the script:
__________________________________
If I manually open the script it works perfectly. But I'd like to have it automatically launch at startup so I saved it as an application and marked it to open at login. It opens at login but after clicking 'yes' the message disappears as it should, but a spinning black and white beachball stays on screen and the application remains open as the ball spins. I have to click on something else to put the application into the background (where it remains open in the dock). If I want to quit the application at this point I'm unable to except through a force quit (or I can wait 20 minutes for the next reminder message and click the 'no' button so the script exits).
I'm wondering:
1) If I keep this application, is it possible to not have the spinning black and white beachball after I click the message's 'yes' button, and just have the application automatically recede to the background/dock?
2) Would I be better off just launching it as a script at startup and not doing it as an application? If so, what's the easiest way to do that, as I've never used Launchd, launchdaemons, or any of that stuff before, but could certainly give it a try.
3) Is there a way to get the reminder message to stay in the foreground (on top of everything else) when it appears? Right now if I have a document or browser open and am clicking something at the moment the message appears, the message gets hidden underneath.
Thanks for any help!
Here's the script:
__________________________________
Code:
set delayTime to 60 * 20
repeat
display dialog "Check it." buttons {"Yes", "No"} default button 1
if the button returned of the result is "Yes" then
delay delayTime
else
exit repeat
end if
end repeat