Is it possible to change the icon of the folder (or file) currently selected in Finder?
Ideally I’d select a folder, run the script and it would change the icon of the folder to that of an icon from a specified location (e.g. ~/Documents/Icons/exampleicon.icns), or if using an .icns file isn’t possible maybe it could copy the icon from another file, folder or application? (e.g. ~/Documents/Icons/foldericon) in the same way you can Get Info on a file, copy the icon, Get Info on another file and paste the icon to it.
Is something like this possible? Any help would be greatly appreciated.
Glad you like it. Just use this in place of theFile line…
tell application "Finder"
set theSelection to selection -- This is a list of selected items, even if only 1 item is selected.
set theFile to (item 1 of theSelection) as text -- Get the first item in the list. We make it text so we can convert it to a posix path for SetFileIcon.
end tell