Loc: United States
Was it nutty who knows this stuff? Can't remember.<br><br>Anyway, is there a way to write an Applescript (or Automator action) that will quit out of Safari (no questions asked) if the program is idle after a certain amount of time? I check my ISP's webmail here at work, but certain times I'll leave it open by mistake when I leave for the day - and if I'm out the following day it remains 'logged in' for anyone (who may need to use my machine) to see & read my messages. <br><br>Help?<br><br>
this code do the job, don't know if is the most efficient way but I think it works. if not you have something to start your own script
1.- Copy the code 2.- Paste in ScriptEditor 3.- define x as a number of minutes you want to wait 4.- Save as application WHIT stay open option cheked
---START CODE---- property x : 5 * minutes -- YOU NEED TO GIVE THIS NUMBER I PUT "5" BUT CAN BE ANY global StartTime
set StartTime to (current date) my Verify_Process()
on Verify_Process() if Check_ActiveApp() then my Reset_StartTime() else my Waiting_Time(x) end if end Verify_Process
on Reset_StartTime() set StartTime to (current date) end Reset_StartTime
on Check_ActiveApp() tell application "System Events" frontmost of application process "Safari" end tell end Check_ActiveApp
to Waiting_Time(x) set StartTime to (current date) + x * minutes if StartTime ≥ (current date) then tell application "Safari" to quit saving no else delay x my Verify_Process() end if end Waiting_Time
Xplain's use of MacNews, AppleCentral and AppleExpo are not affiliated with Apple, Inc. MacTech is a registered trademark of Xplain Corporation. AppleCentral, MacNews, Xplain, "The journal of Apple technology", Apple Expo, Explain It, MacDev, MacDev-1, THINK Reference, NetProfessional, MacTech Central, MacTech Domains, MacForge, and the MacTutorMan are trademarks or service marks of Xplain Corp. Sprocket is a registered trademark of eSprocket Corp. Other trademarks and copyrights appearing in this printing or software remain the property of their respective holders.
All contents are Copyright 1984-2010 by Xplain Corporation. All rights reserved. Theme designed by Icreon.