we're trying to find and use an electron API that let us change the icon of a file (macOS only).
Our app accept a folder from the macOS finder and we want a way/api to get the current folder icon and change it by passing a new icns
or png
file. Is it possible?
You should use the NSWorkspace.setIcon function but there is no way to use this API from electron.
Looks like electron doesn't support the direct access to this API and some related issues exists.
As a workaround you can create (compile) a macos binary that only do this and then exec it from electron code using child_process.execFile.
Thank you Alessandro 😉! Any link or resource to compile that binary?
swift.org/getting-started/#using-the-package-manager to start with swift from cli. Or use xcode.