Desk Exercises

Discussion in 'Automator Scripts' started by kafmil, Apr 4, 2012.

  1. kafmil

    kafmil
    uix_expand uix_collapse
    Registered

    Joined:
    Apr 4, 2012
    Messages:
    1
    Likes Received:
    0
    I have been looking for an application to give me some exercises to do at my desk but just came up with this script instead from some videos I found on lifehacker. Hope it helps someone else out there with neck pain.

    It may not be the most efficient, I am new to AS, I use TimeOut to remind me to take a break and use the launch app feature on the normal breaks to launch this script. Then just watch the video and go through the exercises. I just take a 5 minute break every hour, not the suggested 10, these videos are all around 5 minutes.

    set p to do shell script "echo path_to_file/count.txt"
    POSIX file p
    set theFile to result
    set findThis to ""

    set theFileContent to read theFile
    if result contains 1 then
    set theUrl to "http://www.youtube.com/watch?feature=player_embedded&v=BBh7NQwlFIA"
    set nu_file to (theFile)
    set the_file to (open for access nu_file with write permission)
    write "2" to the_file
    close access the_file
    else if result contains 2 then
    set theUrl to "http://www.youtube.com/watch?v=609d1xgEFY0&feature=related"
    set nu_file to (theFile)
    set the_file to (open for access nu_file with write permission)
    write "3" to the_file
    close access the_file
    else if result contains 3 then
    set theUrl to "http://www.youtube.com/watch?v=DdOyEdqGHm0&feature=related"
    set nu_file to (theFile)
    set the_file to (open for access nu_file with write permission)
    write "4" to the_file
    close access the_file
    else if result contains 4 then
    set theUrl to "http://www.youtube.com/watch?v=6OdNheRuEIU&feature=related"
    set nu_file to (theFile)
    set the_file to (open for access nu_file with write permission)
    write "5" to the_file
    close access the_file
    else if result contains 5 then
    set theUrl to "http://www.youtube.com/watch?v=cawaX9f_EYo&feature=related"
    set nu_file to (theFile)
    set the_file to (open for access nu_file with write permission)
    write "1" to the_file
    close access the_file
    end if

    tell application "Google Chrome"

    activate

    if (count every window) = 0 then
    make new window
    end if

    tell window 1 to make new tab with properties {URL:theUrl}

    end tell
     

Share This Page