Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force item icon refresh in Finder 10.8.2

Can anyone lead me to any useful link for forcing file icon refresh in new 10.8.2 version of Finder?

I'm working on this problem for last few days and I have tried almost any solution which can be found on internet, but those are all old samples which are compatible with old versions of Finder and do not work on newer versions of Finder (which are rebuilt on Cocoa framework).

I tried to use few commands from apple script tool to update files in Finder ('update item with necessity'), I tried few plugins from internet (nudge, finder-Refresh...), I also tried support for communication with external Mac application through ScriptingBridge framework (although very useful) but nothing gave me a desired result.

I have noticed that NSWorkspace class contains two methods: iconForFile and setIcon:forFile, and although I could integrate this two functions in application, iconForFile function is returning image of reduced quality, so I'm stuck in that direction also.

Any idea or suggestion will be highly appreciated.

like image 942
user2381688 Avatar asked May 14 '13 12:05

user2381688


4 Answers

Create a visible file and delete it. This will refresh finder window.

like image 150
Parag Bafna Avatar answered Oct 17 '22 01:10

Parag Bafna


If you need to update one Application icon, just touch the App.app folder.

Close the finder windows and issue the command:

touch /Applications/App.app
like image 37
Vitim.us Avatar answered Oct 17 '22 01:10

Vitim.us


To reset for every application under Mountain Lion, try the following in Terminal:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed -r

That will kill all existing objects in launch services and reseed them recursively from the standard locations (/Applications, etc).

If you have a specific application whose data you need to override existing information, you can try:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f <path>

Although I've had limited luck with the latter working in some cases, so you may end up doing the former afterwards.

like image 23
gaige Avatar answered Oct 17 '22 02:10

gaige


Type into Terminal

killall Finder

Then

killall Dock
like image 37
Katherine Avatar answered Oct 17 '22 02:10

Katherine