towerloha.blogg.se

Sleepwatcher mac run when idle
Sleepwatcher mac run when idle





sleepwatcher mac run when idle
  1. Sleepwatcher mac run when idle how to#
  2. Sleepwatcher mac run when idle download#

If [ ! -d "/Volumes/$."īasically, it runs in an infinite loop and checks every two seconds if iTunes.app is running. If Tunes.app/Contents/MacOS/iTunes ") ]] then VOLUMENAME="your_volume_name" # name of volume to be mounted, typically username on AFP server. PASS="your_password" # for connection to AFP server USER="your_user_name" # for connection to AFP server

Sleepwatcher mac run when idle download#

You can download it from this gist page (look for the "raw" download link). I made a script that connects to a network drive when iTunes is running. Right now this script just displays the results but you can make it do whatever you want at this point. it sets up the application parameters in the "on run" handler and then in "on idle" it can check those parameters. You set how often it runs by returning a number of seconds at the end of the handler. "on run" runs once at application launch. The way a stay-open script works is there's 2 main handlers, the "on run" and the "on idle". Save it as an application and check the "stay open" box to make it stay open after you launch it. So here's an example applescript for you. What you need is an applescript that stays open all the time and performs its tasks periodically. Run a script whenever an application opens I could not get it to work on Lion, some syntax issues need to be resolved. Lastly, it looks like it may possible to write an Apple Script that does exactly what you want, here is a link to something that may be able to work with some modification. Run the script, you can treat it like any other Application.

sleepwatcher mac run when idle

Name it what you like but be sure to set the file format to "Application" on the "File Format:" dropdown. wait 10 seconds adjust this time to meet your needs

sleepwatcher mac run when idle

  • Open the AppleScript Editor application.
  • A program like Network Drive Launcher would aid in automatically scripting and connecting to networked shares when you log in.Īlternatively you could write an Apple Script that would replace clicking on the iTunes icon to start iTunes, not ideal since you would have to click the script first.

    sleepwatcher mac run when idle

    if you are closed to the public at any time during the day, schedule them again.And easy solution would be to automatically have your network shares mounted for you when you log in. in this scenario, i'd use power management or pmset to wake the kiosk, run your delete and reset scripts and let it go back to sleep-say 1/2 and our before the kiosks are available. that would be once a day, but until a better solution can be worked out. One option you may want to consider as a short term solution would be to run your script just before the kiosks become available to the public.

    Sleepwatcher mac run when idle how to#

    it would be great if you could do this right before sleep, or just after wake, but i do not know how to do this. you may have to artificially generate a condition that tells you that the kiosk has not been used for X amount of time. There have been posts about this, but i have not seen a good solution. correct me if i'm wrong, but reading your messages makes it seem that when the machine goes to "sleep", you assume that the previous user is gone and done with the machine (sounds reasonable for a kiosk). What i think you are looking for is a process to run either just before "sleep", or "on wake".







    Sleepwatcher mac run when idle