Copy File Icons

Discussion in 'Mac Programming' started by i.shaun, May 24, 2009.

  1. macrumors 6502a


    May 1, 2008
    'm trying to make a dropplet that takes a file (image) dropped into it, and copies the icon to the clipboard.

    I previously set the image itself as it's own icon using CocoThumbX. My intention is to copy icons from files faster -- and if possible, have another that does the reverse (pastes custom icon on file dropped in).

    Anyway, so far I have this:

    on open files_
    	tell application "Finder"
    		set files_ to POSIX path of files_
    		get icon of files_
    		copy it to clipboard
    	end tell
    end open
    I get error: Can't get <class iimg> of "<path to file>"

    I attempted a command "do shellscript" but when messing with Terminal, I could not get it to do anything to the file. It too would say "access denied".

Share This Page