Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

An AppleScript to reinstall custom icons after updates System
Like many people, I have customized many thing about my OS X setup, not the least of which were app and folder icons. Via programs like CandyBar or LiteIcon, or manually, any and all folder/file/app icons can be changed.

Personally, I like the pure|icns set from Interfacelift. However, there is a problem when programs update -- in my case, Dropbox -- and change their icons back to a boring old Leopard blue. To return my custom icons, I wrote an AppleScript. Since this only happens every now and then, I didn't make the script executable; I just call it from Google's quick search box whenever I need it.

At any rate, this script will copy an icon from some location (file, folder, *.icns), and paste it via the Get Info window for any second location (file, folder, app) that you desire. Of course, change the first two POSIX paths to (1) where the icon should come from, and (2) where the icon should go.
set newIcon to (POSIX file "/this/is/the/path/to/the/icon") as alias
set theItem to (POSIX file "/this/is/the/path/to/the/location") as alias

tell application "Finder"
  activate
  set infoWindow to open information window of newIcon
  set infoWindowName to name of infoWindow
end tell

tell application "System Events"
  tell application process "Finder"
    tell window infoWindowName
      keystroke tab
      delay 1
      keystroke "c" using command down
    end tell
  end tell
end tell

tell application "Finder"
  close infoWindow
  set infoWindow to open information window of theItem
  set infoWindowName to name of infoWindow
end tell

tell application "System Events"
  tell application process "Finder"
    tell window infoWindowName
      keystroke tab
      delay 1
      keystroke "v" using command down
    end tell
  end tell
end tell

tell application "Finder"
  close infoWindow
end tell
This script contains modified code from this script.

[robg adds: I haven't tested this one.]
    •    
  • Currently 3.11 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (9 votes cast)
 
[3,309 views]  

An AppleScript to reinstall custom icons after updates | 8 comments | Create New Account
Click here to return to the 'An AppleScript to reinstall custom icons after updates' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
An AppleScript to reinstall custom icons after updates
Authored by: Mac Berry on Fri, Nov 20 2009 at 9:20AM PST
I don't get it? How can it possibly be better to modify a script with two new paths, then run it, than to cmd>i copy, cmd>i paste?

Even if the suggestion is to save a copy with the paths for each app you might update, the time saving vs the time used must be minuscule.

If it interupted any update process to copy old icon, then paste into the new version, maybe, but I'm afraid this strikes me as yet another script to solve a problem that doesn't exist.

Sorry.

[ Reply to This | # ]
An AppleScript to reinstall custom icons after updates
Authored by: Andrew J Freyer on Fri, Nov 20 2009 at 10:47AM PST
For most of my applications using the Sparkle framework, I have set up automatic updates. I find that whenever a program updates in this fashion, customized icons are ignored and replaced with default icons..

Additionally some apps, Dropbox in particular, change icons without updating. Dropbox for instance likes to change my folder icons to a default icon nearly every time I restart the program.

So, for both of these reasons, I find that my Dropbox icons are changing several times per week.

You're right that it does only take but a moment to fix these icons manually, but it's irritating to have to do this as often as as I do.

So, my solution was to automate this via script to save me small moments of minor irritation several times per week - arguably the very point of automation scripting. :)
Edited on Fri, Nov 20 2009 at 10:51AM PST by Andrew J Freyer


[ Reply to This | # ]
An AppleScript to reinstall custom icons after updates
Authored by: Mac Berry on Fri, Nov 20 2009 at 1:09PM PST
Thanks Andrew. I guess I can see that having a script prepared for a given app, if that app returns to default several times a week, could be handy, though your hint didn't describe that problem.

I think I'd be asking why this is happening though - I have all my apps set up to auto update, and yet very rarely see an icon change. Maybe I just don't use custom icons enough for it to be an issue, though I do use them.

Perhaps you could use your script as a folder action, tied to a folder that you know changes when an app updates? That way you wouldn't have to do ANYTHING?

[ Reply to This | # ]
An AppleScript to reinstall custom icons after updates
Authored by: Andrew J Freyer on Fri, Nov 20 2009 at 1:51PM PST
I actually do have a Hazel (noodlesoft.com) rule that does just that. However, the vast majority of the time, it is the restarting of Dropbox that changes the icon.

It's bad form on Dropbox's part, and I hope that it will be fixed soon.

[ Reply to This | # ]
An AppleScript to reinstall custom icons after updates
Authored by: Andrew J Freyer on Fri, Nov 20 2009 at 7:10PM PST
For anyone who is having trouble with the Dropbox problem specifically mentioned in the comments above - I have started a "Troubleshooting" thread on the dropbox forum:

Dropbox Troubleshooting Forum

Edited on Fri, Nov 20 2009 at 7:11PM PST by Andrew J Freyer


[ Reply to This | # ]
An AppleScript to reinstall custom icons after updates
Authored by: renaultssoftware on Sat, Nov 21 2009 at 9:37AM PST
Not all icons are replacable for folders, I have discovered. If you try to modify /System you usually get an error.

[ Reply to This | # ]
An AppleScript to reinstall custom icons after updates
Authored by: Andrew J Freyer on Sat, Nov 21 2009 at 11:14AM PST
Well, I'm an idiot.

It's FAR easier and FAR better to replace the icons from within the application bundle. DOH!!!

Dropbox - Show Package Contents
Contents>Resources>DropboxFolderIcon_leopard.icns

Replace that icon with the one that you prefer, and the icon ceases to change on restart!

[ Reply to This | # ]
Drivers foe OS 10.6
Authored by: Calin on Mon, Nov 23 2009 at 3:40AM PST
Hello

I want to install an exernal wireless modem, i have the driver for OS 10.5, do i have any chance to install it on OS 10.6

Thanks

[ Reply to This | # ]