Feb 06, '06 06:44:00AM • Contributed by: apple_turnover
It happens to the best of us: Desktop clutter. Try as we might, we always end up with all sorts of files on our beautiful desktop, and if you're anything like me [ie: retentive], it irks you, but you live with it until you can no longer see any remnants of your wallpaper. Then you must finally go through the arduous process of manually filing all that clutter. No more!
Now I know there are lots of ways to keep desktop clutter to a minimum, like changing default download folders, etc. However, I didn't want to sacrifice the convenience of working with archives, files, and such on the desktop in the short run. Instead, I created an Automator workflow (my first such endeavour) to automatically purge my desktop and file that mess for me, and it does the job very well!
This is what I did, you can obviously ammend it to suit your needs...
The objective is to take all the documents I have saved on the desktop for whatever reason, and file them away in logical groupings. Here's an example of the portion of my action that does the filing for my work-related documents. (Note that the following examples show the Auomator Library name, then the action within that library, and then any options for that action.)
- Spotlight - Find Finder Items:
- Where: 'Desktop'
- Whose 'Name' 'Contains' 'Work'
- Finder - Move Finder Items:
- To 'Work,' where 'Work' is the name of a folder in my Documents folder
Next I want to store any media files in the right places:
- Finder - Find Finder Items:
- Where 'Desktop'
- Whose 'Kind' 'Is' 'Audio'
- Finder - Move Finder Items:
- To 'Music'
If you take a lot of screenshots, you might want to do something a little different to filter images on your desktop. Because screenshots> end up on the desktop as nothing more than 'Picture 1,' 'Picture 2,' and so on, I use this group of actions to automatically rename those images to something a bit more descriptive before they get filed:
- Finder - Find Finder Items:
- Where: 'Desktop'
- Whose 'Kind' 'Is' 'Image'
- Finder - Rename Finder Items:
- 'Replace Text'
- Find 'Picture'
- Replace 'Screenshot taken'
- Finder - Rename Finder Items:
- Add Date or Time
- Date/Time 'Created'
- Where 'After name'
- Seperator 'Dash'
- Format 'Month Day Year'
- Separator 'Forward Slash'
- Rename Finder Items:
- Add Date or Time
- Date/Time 'Created'
- Where 'After name'
- Separator 'Dash'
- Format 'Hour Minute Second'
- Separator 'Forward Slash'
- Move Finder Items:
- To 'Photos'
This also works well as a filter for non-screenshot images, too, with the caveat (of course) that it will remove any instance of the word "Picture" from their filenames, and will add all that time and date data to them. If you don't use screenshots that often and don't want all that data added to your image files, just stick to a regular media filter as described above for Audio files.
Next I wanted my filter to move all of my disk images and other archives that littered my desktop and then move them to a folder called Installation Files in my Documents folder. (You can just as easily move them to the trash if you are not a packrat like me.) To do that, I used these steps in my workflow:
- Find Finder Items:
- Where 'Desktop'
- Whose 'Extension' 'Is equal to' 'dmg'
- Move Finder Items:
- To 'Install Files' (or change it to Trash if you want to chuck them)
And that is the gist of it. You can improvise, adding filters to send your URL links t your bookmarks folder, etc., but if you are new to Automator (as I was just two days ago), this explanation should give you the background to make your own Workflow perfect for tidying up your desktop. But there is one final step: How do you run this thing once it is done? There are two options I use. First, save the file as a regular workflow, then:
- Go to Save As Plug-In and from the pop up menu in the Save dialog, choose iCal from the list of apps. Once you do that, iCal will automatically open with a new recurring event that you can set the parameters for. You could, for instance, clean your desktop every night at 1am, or once a year in the spring if you prefer. The best part about this is that you don't have to have either Automator or iCal running for this automation to work. At the set time, the workflow will run and you will see its progress in the menu bar and, tada, your desktop is clear!
- I also wanted a way to manually run the workflow without having to open up Automator, and I wanted to be able to run it from an icon in the dock. So I went to: Save as Plug-in, and chose Finder from the pop-up menu; I called mine DeskTidy. To find the saved workflow, I just typed DeskTidy into Spotlight, and when it came up, I Command-clicked it, then dragged it from its folder onto the desktop. I then changed the icon to an image of nice clean Aqua desktop (to replace the default Robot icon). Since workflows are treated as applications, I was then able to drag it to the dock. Now if I don't want to wait for the designated iCal event, I can clear my desktop manually with a simple trip to the Dock.
[robg adds: I haven't tested this one...]
