AppleScript: Run process after "X" seconds of inactivity

Discussion in 'Mac Programming' started by rock6079, May 16, 2009.

  1. rock6079 macrumors 6502

    Joined:
    Jan 6, 2004
    #1
    I'm working on an AppleScript/Automator process that will essentially act like a screensaver. I will include it as a login item and want it to execute after X seconds/minutes of inactivity (i.e. no keyboard or mouse movement)

    1. If there is no input/activity from user then
    2. Launch /Library/.....CustomSaver.app

    Step 2 is quite easy but I cannot figure out how to get past step one, lol. any ideas/help? :confused:

    Thanks! :)
     
  2. dmmcintyre3 macrumors 68020

    Joined:
    Mar 4, 2007
    #2
    I can do this with a shell script.

    Code:
    Command 1 &
    sleep x (x = amount of time in seconds)
    Command 2
    use osascript from a shell script to run applescript
     

Share This Page