How do I perform a key combination every 10 minutes?

Discussion in 'macOS' started by elitesouth, May 7, 2010.

  1. elitesouth macrumors member

    elitesouth

    Joined:
    Nov 24, 2009
    Location:
    Savannah GA
    #1
    There's an application that I use that performs a command whenever I type CTRL+1 no matter which application I'm in.

    When I'm away, I'd like to have OS X perform that key combo every 10 minutes. How is this accomplished?

    Thanks in advance for your help.
     
  2. zeemeerman2 macrumors 6502

    Joined:
    Feb 21, 2010
    #2
    Dunno. Maybe try AppleScript to make a script of it?
     
  3. elitesouth thread starter macrumors member

    elitesouth

    Joined:
    Nov 24, 2009
    Location:
    Savannah GA
    #3
    Yeah that's what I've seen around the web (don't think I haven't googled it already), but I was looking for more of a direction in which to go on how to set up this Applescript, Automator, etc.
     
  4. Hal Itosis macrumors 6502a

    Hal Itosis

    Joined:
    Feb 20, 2010
    #4
    Probably learning about launchd would be worthwhile (start with man launchd.plist).

    What is this periodic command then?
     
  5. andmr macrumors member

    Joined:
    Aug 25, 2008
    Location:
    NE Florida
    #5
    In addition, you might try the script below. Copy the code and paste it into your AppleScript Editor. Replace "app_name" with the name of the application you desire to be frontmost at runtime. From the Script Editor's File menu select Save As > File Format: application, and be sure to check "Stay Open" under Options.

    The script:

    on idle
    tell application "app_name" to activate -- replace "app_name" with frontmost app
    tell application "System Events"
    key code 18 using control down
    end tell
    return 600 -- repeats in ten minutes
    end idle


    Launch the script prior to leaving your computer, as needed. To quit the script at any time while it's running, click on its docked icon and select Quit from the popup menu. Hope this helps.
     
  6. fhall1 macrumors 68040

    fhall1

    Joined:
    Dec 18, 2007
    Location:
    (Central) NY State of mind
    #6
    The folks on "Lost" could've used a script like that a few seasons ago. :)
     

Share This Page