Category Archives: Tools

Prevent clamshell laptop from sleeping when using AirPlay on Mountain Lion

We cut our cable several years ago and have watched most of our TV on Hulu by connecting a laptop to our TV using an HDMI cable. This has always worked fine, but it was a pain to connect the cables and quite often the sound didn’t work.

I was excited to hear that the new version of Mac OS X (Mountain Lion) would have native support for AirPlay mirroring to our AppleTV. I’ve used apps like AirFlick before, but it never worked with Hulu. I finally had a chance to use the AirPlay mirroring to watch a show last night and was disappointed to find that I couldn’t close the lid to my laptop without it going to sleep.

No physical cable

Previously, I was using an HDMI cable and the TV was essentially a second display. The laptop was smart enough to know that when I closed my lid, it should use the TV as the primary display and not go to sleep. With the lack of a physical cable plugged it, it didn’t know to stay awake.

I could have change my power settings to never go to sleep, but usually when I close the lid, I want it to sleep. I don’t want to have to remember to change my settings before and after I use AirPlay.

NoSleep Extension

NoSleepHelper

Enter the NoSleep Extension by Pavel Prokofiev. It lives in the menu bar and simply prevents my laptop from going to sleep when I close the lid. Clicking the icon toggles the functionality and right-clicking offers a preference pane where it is possible to target the no sleep behavior to only battery or power adaptor environments.

NoSleep 2

This is a great utility that does one simple thing and does it well. Now I can watch my shows and not worry about burning up my display by leaving the laptop open. Kudos to the developer of this app.

Editing Folder Action Scripts

Scanner folder evernote 

I have a Folder Action Script set up where when if I scan a file to a specific folder, it uploads it to Evernote. I have it go to a queue notebook called tofile. This way, when something important comes in, I can scan it to Evernote and shred or recycle the actual document. Additional, the watched folder is in my Dropbox, so I can add files to that folder from my phone or a different computer. The next time I get online with my laptop, Dropbox will download that file, then my action script will kick in and upload it to Evernote.

Anytime I need to make a change to this script, I can never remember where it is or how to edit it. Hopefully by posting instructions here, I’ll remember next time.

Accessing the file:

In Finder, select “Go to Folder” from the “Go” menu and type:

/Library/Scripts/Folder Action Scripts/

To edit the script:

  1. Drag the file to your desktop.
  2. Edit file and save changes.
  3. Drag the file back to the Folder Action Scripts folder. You’ll have to authenticate the operation.

There is no need to reassign the script back to the folder. It just works.

Image source: Markus Malzner