Quickly lock and unlock the icons in your Dock

I often drag files to folders in my dock. If you’ve done this you probably already know why it’s frustrating: if you don’t drag the file to just the right spot, the folder will slide out of the way. If you’re actually trying to add the file directly to the dock, that’s pretty useful, but otherwise it can be pretty frustrating.

The Dock has a little-known secret though: you can lock it. Here’s the secret command you can enter in Terminal:
defaults write com.apple.dock contents-immutable -bool true; killall Dock;

This is easy enough to do, and you can change true back to false if you want to unlock it. If you’re like me, you’re probably not going to remember this next time you need though. So I made a quick script to handle the whole process for me. You can just drop it in your Applications folder or the script menu. (To enable the script menu in Snow Leopard, open AppleScript Editor, open the Preferences, and check “Show script menu in the menu bar”. In earlier versions of OS X, you can do this in AppleScript Utility.)

Download this AppleScript Application

Update: The first version posted wouldn’t work the first time you used the lock feature, which is clearly a problem. It’s fixed now.

Comments

This entry has 3 comments.

Ben

Ben

Or you could just hold Command while dragging to prevent the Dock from opening a space for the file.

Oscar

Oscar

Great script (and nice tip, Ben)!

Rob

Rob

I had the old “Dock Lock” installed when I was running Leopard. When I moved to “Snow Leopard” the old “Dock Lock” keeps asking for Leopard —- is there a way around this?

Nothing to date seems to work..

R

View more

Mac OS X

Notefile: on the Mac App Store, iCloud, and more Now available on the Mac App Store Dashboard is great for simple widgets like Notefile…

Our Mac software, Mountain Lion, and the Retina Display OS X Mountain Lion is now available, and the MacBook Pro with Retina Display has been out…

Junecloud and Lion compatibility The latest version of Mac OS X, Lion, is now available, and you may be wondering if our…

Introducing Notefile Notefile is a project I’ve had kicking around for a long time. It all started with…

Delivery Status for Mac 5.3 beta 4 Update: This beta is now closed, thanks for your help! New in this version: •…