Run script when icon placed on desktop?

How would I go about running a script only when an icon is placed on the desktop?


right click on the desktop, notice the enable folder actions item, click it
right click the desktop again and click configure folder action.

now set up the folder and the scritp.

it may be good to copy the built in add new item script and save it somewhere else, cut all the the stuff out of it that you wont need and configure that script for the folder