3 Replies Latest reply: Jan 26, 2013 7:36 AM by red_menace
MacOSXNoob Level 1 Level 1 (5 points)

Hi!

I have an app I made in Xcode that takes a PNG image that the user chooses and makes it the Finder, Empty Trash, or Full Trash icon. It works well, but there is one thing that bugs me. Because it is making a system change, it requires a password. But the window says "Finder wants to make changes. Type your password to allow this." but I want it to use my app's name and icon. How can I change the script so that the app duplicates, not Finder?

Also, here is my current script:

on EmptyTrashButtonPushed_(sender)

        set EmptyTrashIcon to (choose file with prompt "Choose a PNG icon to use for your Empty Trash icon:" of type {"PNG"} without invisibles)

        tell application "Finder"

            set theDupe to (duplicate EmptyTrashIcon) as alias

            set the name of theDupe to "trashempty.png"

            move theDupe to "Macintosh HD:System:Library:CoreServices:Dock.app:Contents:Resources:" with replacing

        end tell

        do shell script "killall Dock"

    end EmptyTrashButtonPushed_

 

I want it to duplicate the original file so that the user's file stays untouched.

Thank you very much


MacBook Pro, OS X Mountain Lion (10.8.2)