I’m trying to write a script that deals with idle time. I am a beginner at applescript so I was wondering if any one had any suggestions. so far I have successfully written…
tell application “Finder”
if idle time > 3600 then
tell application “Finder”
try
display dialog ¬
“I’m going to restart netscape, is that ok?” buttons {“Yes”, “No”} default button “No”
if button returned of result is “Yes” then
tell application “Finder”
activate
select file "Netscape "
open selection
end tell
else
if button returned of result is “No” then
end if
quit
end if
on error
beep
display dialog “There was a problem launching netscape.” & ¬
“please restart computer” buttons ¬
{“Yes”} default button 1
end try
end tell
end if end tell
…but when I run my script it gives me the error “Finder got an error: Can’t get time” on line 2. Any feedback would be greatly apprecaited.
Regards.
it’s a simple error. There is no “idle time” variable to check. The format is:
on idle 600 -- 10 minutes
(* do stuff *)
end idle
and you need only one (I think) finder tell block
on idle 600
tell app "Finder"
(* do stuff *)
end tell
end idle