At my work, I have a motorized standing desk. I was looking for apps that would remind me to stand and sit at regular intervals. In the long run, I want an app that conditions me, so it starts at standing for an hour a day for a week, then two hours a day for a week, and so on and so forth. I can’t find that app. Instead I made a quick AppleScript that will prompt me to change position every 45 minutes.
set answer to ""
repeat while answer ≠ "Quit"
set answer to the button returned of (display dialog "Please rise." buttons {"Quit", "Okay"} default button 2)
log answer
if answer = "Okay" then
delay 2700
else if answer is equal to "Quit" then
tell me to quit
end if
set answer to the button returned of (display dialog "Please be seated." buttons {"Quit", "Okay"} default button 2)
if answer is equal to "Okay" then
delay 2700
else if answer is equal to "Quit" then
tell me to quit
end if
end repeat
It’s been a long time since I’ve done any AppleScripting. I forgot how human it is. I expected not equal to to be !=, when it’s just the not equal to sign (≠). I expected else if to be elseif.
I’ve thrown it up on my GitHub repo, you can find that here. A compiled version can be found here.