iconset icon indicating copy to clipboard operation
iconset copied to clipboard

[Bug report] Only works on 1 of 4 apps I tried

Open thataboy opened this issue 1 year ago • 1 comments

Using iconset v1 on Sonoma 14.5

It only works on one app (Spotify) out of the four I tried. The others that didn't work were Google chrome, Google chrome beta, and foobar2000; they get a generic blue folder icon instead.

It is not the icns file that is the problem because I'm able to set Spotify.app to the chrome icns file but setting Google Chrome.app to the spotify icon gives me a blue folder for icon.

command and output:

sudo iconset folder ~/Downloads/icons
Password:
[i] The following icons were successfully set:
  - Spotify.icns Spotify.app

[x] The following icons failed to set:
  - Google Chrome Beta.icns - Missing permissions to set attribute
  - foobar2000.icns - Missing permissions to set attribute
  - Google Chrome.icns - Missing permissions to set attribute

[i] Cache purged successfully. Updated icons will show on Application relaunch

Incidentally, this is the exact behavior I get with this test Applescript

use framework "Foundation"
use framework "AppKit"
use scripting additions

set sourcePath to "/Volumes/T7/Downloads/chrome dark.icns"
set destPath to "/Applications/Google Chrome Beta.app"
set imageData to (current application's NSImage's alloc()'s initWithContentsOfFile:sourcePath)
(current application's NSWorkspace's sharedWorkspace()'s setIcon:imageData forFile:destPath options:2)

which I think uses the same Foundation call as your app.

I'm not sure what makes Spotify different. Maybe because it's an Electron app?

Thanks

thataboy avatar Jun 24 '24 22:06 thataboy

Have you tried running iconset with sudo? That's what the specific issue that was logged out will generally mean. And yes it depends on how the app was installed. It's why App Store apps need sudo as well.

tale avatar Jul 01 '24 19:07 tale