2

I carry my Macbook Pro (15" Retina, Mid 2012 with Mt. Lion) between my work and home. It is connected to an external HDD as a Time Machine. I always forget to properly eject the HDD before putting my notebook to sleep (I rarely shut it down) at my office.

Is there a way to have it prompt with a custom reminder or warning when I try to put MBP to sleep, using Automator or something?

3
  • 1
    Do you put it to sleep by closing the lid? Using the keyboard shortcut? Selecting Sleep from the menu?
    – Daniel
    Commented Aug 9, 2012 at 16:05
  • I do it by going to the Apple menu. Closing the lid would not give me any chance to see the warning.
    – Ki Kim
    Commented Aug 9, 2012 at 18:04
  • Right. That's why I asked.
    – Daniel
    Commented Aug 9, 2012 at 18:16

2 Answers 2

1

You can write an AppleScript to do this, then instead of picking sleep from the  menu, you can select your script from the Script menu.

All of this can be set up from within AppleScript Editor:

  • Launch AppleScript Editor

  • Open Preferences

  • Check the box to "Show Script menu in menu bar". enter image description here

  • Create a new script

  • Here is the content of the script:

    display dialog "Are you sure you want to put the computer to sleep?"
    do shell script "pmset sleepnow"
    
  • Save the script as ~/Library/Scripts/Applications/AppleScript Editor/Sleep.scpt

Now you can put your computer to sleep from the script menu and be warned before sleeping.

1
  • Thanks, that's pretty much what I was looking for. Will try at the end of the day.
    – Ki Kim
    Commented Aug 9, 2012 at 21:13
1

You could have the drive automatically ejected when you sleep the mac instead?

Quick search found Jettison on the Mac App Store http://itunes.apple.com/us/app/jettison/id447430809?mt=12

There is also an app you can use to run Apple script on sleep/wake: http://www.lagentesoft.com/scenario/index.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .