9 Replies Latest reply: Jan 17, 2014 5:41 AM by stoneagrange
All_Time_Low Level 1 Level 1 (0 points)

Is there a shortcut to put your computer to sleep/restart/shutdown?


iMac, OS X Mountain Lion (10.8.2)
  • 1. Re: Is there a shortcut to put your computer to sleep/restart/shutdown?
    parker612 Level 4 Level 4 (1,195 points)

    Control-Eject

     

    The dialog box "Are you sure you want to shut down your computer now?" appears with options to Restart, Sleep, Cancel or Shut Down. After the dialog appears, press the R key to Restart, press the S key to Sleep, press the Esc key to Cancel, or press the Return key to Shut Down.

     

    Control-Command-Eject

     

    Quits all applications (after giving you a chance to save changes to open documents) and restarts the computer.

     

    Control-Option-Command-Eject

     

    Quits all applications (after giving you a chance to save changes to open documents) and shuts the computer down.

     

    Command-Option-Eject

     

    Puts the computer to sleep.

     

    Shift-Control-Eject

     

    Puts all displays to sleep.

     

    Power button (if the computer is not responding)

     

    Press and hold the power button on the computer for six seconds to shut down the computer.

     

    (http://support.apple.com/kb/HT2448)

  • 2. Re: Is there a shortcut to put your computer to sleep/restart/shutdown?
    All_Time_Low Level 1 Level 1 (0 points)

    Thanks Parker!

  • 3. Re: Is there a shortcut to put your computer to sleep/restart/shutdown?
    FrenchToast Level 3 Level 3 (570 points)

    I know this thread is old (not yet archived, though), but I'll add my two cents, because I managed to indifferently put my MacBook Pro to sleep or hibernate it with the help of two AppleScripts and this nifty little freeware application called Quicksilver.

     

     

    The first script puts the Mac to what I call "Simple Sleep" (i.e. data remains stored in the RAM, nothing gets written to disk):

     

    tell application "System Events" to activate

    do shell script "sudo pmset -a hibernatemode 3" password "your_admin_password" with administrator privileges

    do shell script "pmset sleepnow"

     

    In QuickSilver, I gave it a trigger (choose your own, mine is Command-Option-S, for Sleep). If I want to put my MBP to sleep, I just press those three keys.

     

    The second script will hibernate my Mac (RAM content gets written to disk, but to speed things up and not keep corrupted RAM content on resume, I've added a purge command, or to be more exact, I invoke the Purge application that can be downloaded for free from any Mac-oriented software download website, such as MacUpdate):

     

    tell application "Purge" to activate

    delay 1

    tell application "System Events" to activate

    do shell script "sudo pmset -a hibernatemode 1" password "your_admin_password" with administrator privileges

    do shell script "pmset sleepnow"

     

    I gave it a Command-Option-H (for Hibernate) trigger in QuickSilver, but again, you can choose your own.

     

    I saved both scripts as applications to be able to invoke them within QuickSilver.

  • 4. Re: Is there a shortcut to put your computer to sleep/restart/shutdown?
    rkaufmann87 Level 8 Level 8 (42,145 points)

    well that is one way, definetely clever but totally unnecssary. You can easily put a Mac to sleep by Shift - Control - Eject, takes less than a second.

  • 5. Re: Is there a shortcut to put your computer to sleep/restart/shutdown?
    FrenchToast Level 3 Level 3 (570 points)

    I agree, but in the case you depicted, you only get the action defined by your pmset mode.

     

    In other words, if your pmset is set to 3, you put your Mac to sleep. If it's set to 1 and you only want to put your Mac to sleep, pressing those three keys will put your Mac in hibernation / deep sleep no matter what.

     

    As for my scripts being clever, I don't know: I got tips from all over the place to put them together. They suit my needs, so I stick to them.

     

    I wish Apple would propose a way to suspend or hibernate a Mac the way Windows does, by including both options in the shutdown dialogue.

     

    Like I said: my two cents, not more.

  • 6. Re: Is there a shortcut to put your computer to sleep/restart/shutdown?
    bluetortilla Level 1 Level 1 (25 points)

    As I have a Mac Mini with no drive and hence nothing to eject, how do I assign just the Eject key to display the dialouge without the Control key?

  • 7. Re: Is there a shortcut to put your computer to sleep/restart/shutdown?
    seventy one Level 6 Level 6 (8,990 points)

    What is the problem with Apple logo, top menu left, and choose from the drop down menu.   Okay, that takes 2 seconds as opposed to RKs one second almost instant alternative ... but what's the hurry.

  • 8. Re: Is there a shortcut to put your computer to sleep/restart/shutdown?
    bluetortilla Level 1 Level 1 (25 points)

    We all have our own unique preferences. 

  • 9. Re: Is there a shortcut to put your computer to sleep/restart/shutdown?
    stoneagrange Level 1 Level 1 (0 points)

    On my Mac Pro, after the dialog appears, pressing the C key does not cancel the action. I find the easiest way to navigate this box is to use the tab key which toggles the outline of the buttons. Then by pressing the space bar, the outlined button is executed.