is there a way of removing the custom icon from a file, not the icmc image within the application but the custom icon you can add by pasting it in the get info window! the goal is to remove this pasted icon so that the only icon left is the original icmc icon.
tell application "Finder" to activate
tell application "System Events"
keystroke "i" using command down
keystroke tab
keystroke delete using command down
end tell
I must say this does the job, but its not neat, is there a way of doing this without any additional windows? the user must not see anything at all.
Hi, I found this code, but I can make it work … any idea in why will help!
on removeCustomFolderIcon(theFolderAlias)
try
do shell script "rm " & quoted form of ((POSIX path of theFolderAlias) & "Icon" & return)
tell application "Finder" to update theFolderAlias
end try
end removeCustomFolderIcon
set thesize to size of (info for x) as number
if thesize is greater than 1500000 then
tell application "Finder" to activate
tell application "System Events"
try
keystroke "i" using command down
keystroke tab
keystroke "x" using command down
keystroke "w" using command down
end try
end tell
end if
it will only activate if someone changes the icon so its not that bad
With all respect, the solution StefanK posted to you in the thread " change the file icon of the current applet" is much better, as it doesn’t involve any ui scripting, which is a flaky business really.