I have a script that monitors my computer’s activity and my computer’s idle time is useful. I use this command to calculate the idle time:
do shell script "ioreg -c IOHIDSystem | perl -ane 'if (/Idle/) {$idle=(pop @F)/1000000000; print $idle,\"\";last}'") as integer
While running, my script logs it’s own activity. While I thought that my computer was idle during the night, my script’s log confirms that the idle time is resseted frequently without any apparent reason. During day time it is difficult to see, because I am working on the computer.
With console, I checked the console and system log file and didn’t see anything occuring at the same time that my script confirms that idle time has been resetted. Where could I have access to other of my computer’s log file to find out the responsible ?
It did it again … in full day time ! What log can I examine to discover what activity is reseting the ideltime of my computer ? There is for sure an explanation … The idletime resets itself for no apparent reason and without any mouse move nor keyboard press.
I noticed quite a while ago that the shell script you use gives different results depending on how it is run. An application using on idle {} etc. returns the correct value but the same applescript ((do shell script "ioreg etc.) run by Cronnix doesn’t (often returns 0). When discussed a couple of years ago perhaps on this forum it was considered to be a bug. I am not sure whether it has ever been fixed…
Thanks for your help. There was an error in my script and a line of code was trying to permutate to the session opening window when it was already there. Executing that line of code was interrupting the idle time.
I regret to have posted this thread for nothing …
Thanks for this forum … no replies also helps resolving problems !