Friday, December 22, 2006

Desktop Cleaner

I was watching the latest MacBreak Weekly video because I love Merlin Mann and track him incessantly, and he mentioned the application Hazel (Mac OS 10.4+). The theme of the videocast was things to help you un-distractify your Mac, and Hazel fits the bill by cleaning up extraneous files and doing things with them.

I thought this app would be perfect for cleaning up after Firefox. I specified a Temporary folder for it to download things to, but that only works when I save files and not when I select "Open in...". So I browsed around the Hazel website for a while, but my college student instincts ("Don't pay for anything you can get a functional facsimile of for free/cheap or make yourself") kicked in, and I decided to make such an application myself.

I was able to use Automator, while learning some in the process, to cobble together a working application that gets any documents, images, or disk images and moves them into that file type's respective subfolder in my "Desktop Cleanup" folder. I say "working" because it's not very ideal. For one thing, the program finds any files on the desktop or (and here's the problem) any FOLDERS that are on the desktop. Sort of annoying, but I can move those folders and put aliases to them on the desktop instead. Another problem is that, if there are any files that don't fit into the 3 categories specified, you have to manually move them OR add another Action to the workflow. I'll probably be changing it as I go along.

Eventually I'll upload the workflow and the application, but for some reason I can't upload anything from where I am now. For now, you'll have to settle for an explanation. The workflow just consists of pairs of linked commands:
  1. Find Finder Items
  2. Move Finder Items
I've set each Find Finder Items command to find items matching one criterion having to do with the kind of file it is: Kind=Audio, Kind=Document, Extension CONTAINS dmg, Extension CONTAINS zip, and Kind=Image. Audio needs to come before Document because otherwise the program will count some music files (.m4p at least) as documents. The reason that's a problem is because I have each Move Finder Items command set to move the found items to a certain type-specific subfolder of my "Desktop Cleanup" folder. Also, it's important to make sure to select "Ignore Results from Previous Action" for each Find Finder Items command, so that the sequence for each file type is separate from its neighbors.

No comments: