Organise

Mac Productivity Timer Reminds You To Spend Time Wisely

Mac OS X only: Reader Talha writes in with an update to yesterday’s productivity script—now Mac users also have a reminder that asks every so often whether you are spending your time wisely.

Just like the productivity reminder for Windows, this one pops up a dialog every 20 minutes asking whether you are spending your time wisely. If you click Yes, the timer starts over again, otherwise the script exits—very useful for keeping yourself focused when there are a lot of distractions around.

To create your own productivity reminder, you’ll just need to follow a couple of simple steps:

  1. Paste the code below into ScriptEditor, which is located in Applications/AppleScript.
  2. Save as Productivity Timer or whatever name you like on your desktop or other location.
  3. Double-click and you are good to go.

The full script is as follows:

– Mac Productivity Timer — written by Talha F. Basit — april 06, 2009 — questions,comments talha[at]macdotcom — delay uses seconds in AppleScript, not milliseconds like VB set delayTime to 60 * 20 repeat display dialog “Consider if this is really how I should be spending my time. Continue?” 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

Great job, Talha!

Comments (AU Comments | US Comments)

  • irish_stickman

    i would find this very annoying, maybe if it had a list of time wasting websites and would only pop-up if you had one open

    then again, i don't have a mac so i should go sit in the corner for this one

  • AbnerManius

    On the windows thread someone was saying they modified the code to make it appear at a random time and display different messages, does anyone know how to do this for a linux machine? There's already a code up here: http://pastebin.ca/1384413 how to modify it?

    AbnerManius

  • talhabasit

    There is actually a small improvement in the script suggested by Gabriel Sterritt, one of my colleagues. Add an 'activate' without the quotes after the repeat and you won't have to watch the dock bounce, but the productivity timer will automatically come to the forefront.

    talhabasit

  • Alex Price

    Um, I did write a (slightly shorter) version of this right at the top of the comments for the original, but it's cool... :P

    Alex Price

  • StopDistractions

    There is an application for Windows that blocks access to distracting websites like Facebook, MySpace and Twitter... so you can GET WORK DONE!

    Check it out: [www.StopDistractions.com]

  • TheGuardian

    Really? Another productivity checker, LH? I've already got a mother =D

  • processfive

    I've actually modified the VB script provided in the original article:

    -----------------
    yesMinutes = 20
    yesSeconds = yesMinutes * 60
    yesMilliseconds = yesSeconds * 1000

    noMinutes = 5
    noSeconds = noMinutes * 60
    noMilliseconds = noSeconds * 1000

    noCount = 0

    do
    userContinue = msgBox ("Focus Check: is this really how you should be spending your time?" & vbCrLf & vbCrLf & "(you have already wasted " & noMinutes * noCount & " minutes today)", vbYesNoCancel + vbSystemModal )
    yesVal = 6
    noVal = 7
    cancelVal = 2
    if userContinue = yesVal then
    Wscript.sleep yesMilliseconds
    elseif userContinue = noVal Then
    noCount = noCount + 1
    Wscript.sleep noMilliseconds
    end if
    loop While userContinue > 2

    ----------------

    The focus of the script has changed a little here; rather than being poked and asked to click "yes" every time, I am asked to evaluate my situation and report it honestly. If I am on-task, the script gives me another 20 minutes before bugging me again. If I am not on-task, the script takes note and bugs me again in five minutes to see if I've corrected the situation. Each time the script bugs me, it also reminds me just how much estimated time I have wasted -- I find that as this number grows, I treat the reminders with greater urgency. And obviously, if I am engaged in something where I do not need to be bugged, I can dismiss the script permanently.

    processfive

  • rychdom

    AppleScripting is way fun, but there's also Time Out.

    It can get annoying if you set it up at too short an interval, but I find it really useful when I'm sucked in to some deep coding and need to rest my eyes/stretch my legs.

    And, hey, it'll run AppleScripts, so all is not lost! :)

  • ReedSturgeon

    @processfive: Great edit! Thank you.

    ReedSturgeon

  • EellenVixx

    @processfive: Is that script also for Mac. If it is I found a problem when compiling it Wscript.sleep yesMilliseconds Script Editor says "Expected end of line but found unknown token."

    EellenVixx

  • carl_c

    You achieve a similar effect just using a [url="http://manage-this.com/self-check-timer/"]countdown & repeat timer available on most wristwatches[/url]. The added benefit is that this can nag you to be productive even when you're away from your computer.

  • mtemple

    @processfive: Great VB script! The customization and ability to dismiss completes the script. Only wish it was also in applescript.

    mtemple

  • blackcat77

    Either you have self-discipline or you don't. An irritation like this will just get uninstalled sooner rather than later.

    blackcat77

  • JamesCephalus

    check out remind-o-matic, does a similar thing without having to modify the code of an Applescript. Also, and useful if you have trouble making decisions, check out blue-faced monkey – both here: http://www.themacguy.co.uk

    JamesCephalus

  • Steve

    Wow! This is great.

  • ZanScaevola

    I could probably do this for my Linux box 10 seconds using a bash script, sleep, and zenity. In fact, that's exactly what I'm going do!

    ZanScaevola

  • mtemple

    Here is an edit of the script that I tinkered with
    -- Mac Productivity Timer
    -- written by Talha F. Basit (Edited by Mark Temple)
    -- april 06, 2009 (Edited April 8, 2009)
    -- questions,comments talha[at]macdotcom (For questions, comments email me at mtemple19[at]gmaildotcom)
    -- delay uses seconds in AppleScript, not milliseconds like VB
    set delayTime to 60 * 15

    repeat

    display dialog "Consider if this is really how I should be spending my time. Continue?" buttons {"Yes", "No"} default button 1
    if the button returned of the result is "Yes" then
    delay delayTime
    else
    display dialog "Take a two minute break now, and ask why are you really procrastinating?" buttons {"Okay"} default button 1
    if the button returned of the result is "Okay" then
    delay delayTime
    else
    exit repeat
    end if
    end if
    end repeat

    mtemple

  • mtemple

    @mtemple: If you compile it in Script editor it will work perfectly normal

    mtemple

  • RosalbaBriseis

    @mtemple: This is my version of the productivity script. Heavily altered - it keeps track of work time, and time spent dossing. Oh, and it gives you a 15 minute break every hour (two 30 minute sessions) of work :) set newline to ASCII character 10 set delayTime to (60 * (random number from 4 to 15)) --4 to 15 minutes to get started set workTime to (60 * 30) set n to 0 delay delayTime repeat repeat while n < 2 tell application "Finder" display dialog "Consider if this is really how I should be spending my time. Continue?" buttons {"Yes", "No"} default button 2 with icon note if the button returned of the result is "Yes" then delay workTime --30 minutes to do the work you said you were doing... display dialog "You've now worked for " & (workTime / 60) & " minutes, well done!" buttons {"OK"} default button 1 with icon note if button returned of result is "OK" then display dialog "Are you still using your time wisely? What do you think?" buttons {"Yes", "No"} default button 2 with icon note if button returned of result is "No" then display dialog "Take a two minute pause to ask yourself exactly why you're procrastinating." & newline & newline & "You have now wasted " & (delayTime / 60) & " minutes." buttons {"OK"} default button 1 with icon stop if the button returned of result is "OK" then delay (60 * 2) set delayTime to (delayTime + 120) --adding two minutes to the counter end if else set workTime to (workTime + 1800) --totting up the time worked delay (60 * 30) end if end if else display dialog "Take a two minute pause to ask yourself exactly why you're procrastinating." & newline & newline & "You have now wasted " & (delayTime / 60) & " minutes." buttons {"OK"} default button 1 with icon stop if the button returned of result is "OK" then delay (60 * 2) set delayTime to (delayTime + 120) --adding two minutes to the counter end if end if end tell set n to (n + 1) end repeat tell application "Finder" display dialog "You now have a 15 minute break for working so well!" buttons {"Great!"} default button 1 with icon note if button returned of result is "Great!" then delay (60 * 20) --20 minutes is used incorporating 5 minutes to get back in the zone set n to 0 end if end tell end repeat

    RosalbaBriseis

Post Your Comments

Got something to say? There are two ways to comment:

1. Guests

Click here to comment instantly.

2. Facebook Users

Click below to comment using your Facebook account.

We're looking for comments that are interesting, substantial or highly amusing. If your comments are excessively self-promotional, obnoxious, or even worse, boring, you will be banned from commenting. All comments are moderated.