Scripting icon using wallpaper

I would like to be able to use my existing desktop wallpaper as an icon for an application I am writing that will be in the dock. So far I have been able to get the wallpaper by using:

set deskPic to (desktop picture) as alias

but I have no idea how to set the icon of “this” app given the image. Can anyone point me in the right direction?


I don’t quite understand. Is this a one time thing or do you always want to have the icon of the app equal to whatever the desktop picture happens to be? If it is a one time situation, you should look into an icon tool (I like IconBuilder Pro for Photoshop) and the tools that come with the Developer CD (icns Browser & IconComposer). If it is to be dynamic, I’m fairly certain the icon feature of the Finder is broken via AppleScript but you may be able to do it via GUI scripting.


Bummer… I would like to have the icon update dynamically. I guess I’ll take a look at GUI scripting.