custom leopard stacks (dated added)

so the stacks in leopard have been a source of frustration around the web. the main problem is that the stacks will change icons depending on what’s inside that folder and how you have them set to sort.

so an “applications” stack set to sort by name will show the “address book” icon instead of the applications folder icon. the downloads icon which is normally set to “date added” (which is useful) will constantly change icons depending on what you last added.

the problem with this is at a glance you can’t tell which icon is which because it’s either constantly changing or looks like all the other folders you have in there. for further explanation see this article.

and so since it’s release mac fans everywhere have been trying to get the stacks icons to stick. some work arounds work fine when you sort the stack by name, sort by creation date, or even when sorting by date modified.

but search as i may i couldn’t find a way to have the icon stay if it was sorted by “date added”. after a week with Mac OS X 10.5 installed on my machine i finally figured out that i could create a folder action for the downloads folder.

my method is kind of sloppy since i’m not proficient at all with applescript but it works nonetheless.

so here goes:

i added the icon that i wanted to represent the download folder inside of that folder. i used the icon set from this site.
then i opened up automator and told it to record my actions. (you’ll have to “enable access for assistive devices” from the universal access system preferences) this is what it recorded: open finder - click on downloads folder - click on “downloads icon” - delete “downloads icon” - undo - close finder window.
i selected the option to speed up the action by 10x.
then save it as a script plug-in “folder action”, click “enable folder actions”, and then attach that action to the downloads folder.

so it’s functional but like i said it sloppy. it’s sloppy because whenever i download anything it’ll “seize” the mouse for a couple of seconds while it runs the folder action. in fact for some unknown reason it’s running the script twice. perhaps once for the new item that i actually downloaded and then again for the downloads icon that was deleted and then added again. thankfully it stops after that and doesn’t continue on an unending cycle.

if you’re an applescript genius and can set this same thing up without the “mouse” hijacking please send me a script or link to one. or simply paste the script in the comments below.

oh and thanks in advance!