huwmart.in
My Use Cases #1: Reset Launchpad with Keyboard Maestro

Inspired by Philip Baeten’s awesome post on how he uses Keyboard Maestro from last week, I’m planning to start a new series of posts here at huwmart.in, simply, and aptly called: My Use Cases. The plan is to cover use cases for great productivity app’s like Alfred, BetterTouchTool, Keyboard Maestro, Hazel, MercuryMover and hopefully many more, one use case at a time. Because, knowing from personal experience, it’s pretty tough to actually get to grips with some of these great app’s until you find some (hopefully) interesting things to do with them.

So thats going to be my job during this series. And to get the ball rolling I want to talk about one macro i’ve set up in Keyboard Maestro myself. Some of the best uses for Keyboard Maestro are when you find yourself going through the same process over and over, and really don’t want to go through that anymore, and it’s stuff like that i’m going to try and highlight during this small series.

Since the swich to Mac OS X Lion one of the new features I was expecting to hate but actually rather enjoy now is Launchpad, the only problem i’ve found is that it doesn’t play particularry nice with non-App Store applications - meaning that if you uninstall an app that wasn’t downloaded from the Mac App Store, Launchpad won’t register the change and you’ll end up with an ugly mess like this one where the icons stick around but aren’t linked to anything.

Launchpad gets messy Fourtanately it was found pretty quickly that you can reset Launchpad by deleting a database file found in ~/Library/Application Support/Dock/ and then running the Terminal command killall Dock, both of which can actually be condensed into one Terminal command rm ~/Library/Application\ Support/Dock/*.db; killall Dock to delete the file and kill the Dock forceing Launchpad to reset. And although thats all well and good i’d rather not have to open the Terminal every time I want to reset the Launchpad, so, naturally, I threw together this really short and simple Keyboard Maestro macro where it’s triggered by the hot key ⌥⌘L to execture a shell script containing the aforementioned Terminal command:

rm ~/Library/Application\ Support/Dock/*.db; killall Dock

And that just deletes the file and forces Launchpad to create a new database with your current list of applications, it’s also worth noting that it’s best to set Keyboard Maestro to “ignore results” from the shell script to completely annoy the Terminal.

Reset Launchpad with Keyboard Maestro