0

I am having trouble finding an answer of how I could do this.

Basically what I want is to have a program start automatically when it detects that I am using the computer. So for example say I stop using the computer for a few hours and then come back, it would detect this and then open another program or something.

I am looking for a solution in Ruby/python/objective c/Applescript preferably. But anything would work.

I'd like it to work on Snow Leopard.

Any suggestions would be great!

Mario S
  • 11,715
  • 24
  • 39
  • 47
Jonovono
  • 3,437
  • 5
  • 42
  • 64
  • 1
    I found this which was very helpful as well: http://stackoverflow.com/questions/3134901/mouse-tracking-daemon – Jonovono Nov 03 '12 at 22:49

1 Answers1

1

You can monitor all events in the system using NSEvent addGlobalMonitor.... Keep track of the time between two successive events, if it's over a treshold, it means the user was inactive for that time.

millimoose
  • 39,073
  • 9
  • 82
  • 134