PDA

View Full Version : AppleScript: Run process after "X" seconds of inactivity




rock6079
May 16, 2009, 02:32 PM
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! :)



dmmcintyre3
May 17, 2009, 06:17 PM
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! :)

I can do this with a shell script.

Command 1 &
sleep x (x = amount of time in seconds)
Command 2

use osascript from a shell script to run applescript