set newIcon to (POSIX file "{{icon}}") as alias
set theItem to (POSIX file "{{package}}") as alias

tell application "Preview"
    activate
    open newIcon
    delay 1
end tell
tell application "System Events"
    tell process "Preview"
        keystroke tab
        delay 1
        keystroke "a" using command down
        delay 1
        keystroke "c" using command down
    end tell
end tell
tell application "Preview" to quit

tell application "Finder"
    activate
    set infoWindow to open information window of theItem
    set infoWindowName to name of infoWindow
end tell

tell application "System Events"
    tell application process "Finder"
        tell window infoWindowName
            keystroke tab
            delay 1
            keystroke "v" using command down
        end tell
    end tell
end tell

tell application "Finder"
    close infoWindow
end tell
