I’m bit a of a tidy-freak when it comes to icons, desktops and overall system organisation … geeky? Yes. Easier to work with afterwards? Definitely.

So now that I’m using a Mac I’ve been slowly getting used to organising things better – including the Dock. I’ve got everything ordered how I want but still thought it was a bit of a mess (visually) so I tried to find a way of adding some space to the Dock, thereby creating ‘groups’ of Dock icons. Yes, I know about stacks but they didn’t do what I wanted.

All you need to do is run a pretty simple shell script to get it done. There are 2 scripts to use, one for the Applications side of the Dock and the other for the Documents side of the Dock. By ’side’ I mean the parts of the Dock on the relevant side of the existing resizer/splitter thingy.

Shell script I hear you say? Bad! Well … no, not as bad as you might think. Thankfully OS X has a built-in scripting language all of its own called … wait for it … AppleScript. From AppleScript you can run shell commands which you don’t even need to mess about in the shell if you don’t want to. For the Windows people out there think of this example as a batch file – the end result is the same.

Anyway, fire up the AppleScript Editor (it’s under Applications/Utilities if you haven’t moved it) and paste the following script into it. Note that this one is to add a spacer to the Application side of the Dock!

Add a spacer to the Applications side of the dock:

-- add a spacer to the Application side of the Dock
do shell script "defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'"
-- restart the Dock
-- process names are case-sensitive!
do shell script "killall Dock"