Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Use Automator to control display sleep and muting Apps
There have been various tips on how to easily put the display of your Mac to sleep while keeping the hard disk awake and active. But none have really accomplished what I wanted to do, so I came up with my own solution.

Using Automator, I have created a workflow/app that will mute the computer, set the display to sleep after one minute of inactivity, and raise a pop-up menu, at which point you can do one of two things: either lock the settings into place, or turn off the program and reset the display sleep time and volume to your own specifications.

Launch Automator, and enter the following sequence of coammands...
  1. Click on the System Library entry, then drag (or double-click) the Set Computer Volume Action to the right-hand work area.
  2. Select the Automator Library, and drag the Run AppleScript Action into the work area. For the script, use this:
    on run {input, parameters}
    
      do shell script ("pmset displaysleep 1") password "qrwew" 
      with administrator privileges
    	
      return input
    end run
    Change qrwew to your amin password.
  3. Drag the Ask for Confirmation Action (also in the Automator Library) to the work area. You can customize this pop-up box as you wish. For mine, I have Message set to Display Sleep, Cancel has been changed to Lock, and Go has been changed to Restore.
  4. Still in the Automator Library, drag the Run AppleScript Action into the work area, and enter this code:
    on run {input, parameters}
    	
      do shell script ("pmset displaysleep 0") password "qrwew" 
      with administrator privileges
    	
      return input
    end run
    Again, change qrwew to your admin password, and display sleep time to whatever you want (as is with 0, the display will not sleep).
  5. Back in the System Library, drag the Set Computer Volume action to the work area. Change it's setting to whatever you normally set your volume to.
When you're done, save the whole thing as an application. This works especially well with CornerClick, because you can set it to a corner, click there, and the program runs!

If you lock the settings in place and wish to change them back, simply run the program again and click Restore. Locking the settings into place is a great way to set your laptop up for class or work, so it is muted and saves battery by not running the screen all the time. And just leaving it running is great for running downloads overnight, and easily reverting to your normal settings in the morning!

[robg adds: I haven't tested this one...]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[14,203 views]  

10.4: Use Automator to control display sleep and muting | 3 comments | Create New Account
Click here to return to the '10.4: Use Automator to control display sleep and muting' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use Automator to control display sleep and muting
Authored by: Anonymous on Jul 27, '06 02:58:34PM

I have a small bash script that goes like this:

pmset -c displaysleep 1 force ; sleep 70 ; pmset -c displaysleep 60 f
orce

I execute this script and the display will go to sleep in one minute (if I don't touch anything), after which time the sleep time goes back to my (preferred) 1 hour. Using pmset with the "force" option does not modify the system-wide .plist file, so it does not require the bothersome password entry for Admin privs.



[ Reply to This | # ]
10.4: Use Automator to control display sleep and muting
Authored by: kanny on Jul 27, '06 06:48:42PM

I sort of mixed the two hints. I used 'pmset displaysleep 1 force' and 'pmset displaysleep 20 force' and set the two buttons to '1 min' and '20 min' respectively. The message is set to 'Display Sleep Time' with comments 'Audio volume to reduce during sleep'. I also set the top-right CornerClick for this app.

This is cool hint that i was looking for! Thanks.



[ Reply to This | # ]
10.4: Use Automator to control display sleep and muting
Authored by: holyjaw on Jul 30, '06 03:02:27AM

By keeping the Hard Disks active, does this also keep my WiFi connection active?

I can't stand when my MBP goes into sleep mode even if it's plugged in..



[ Reply to This | # ]