icons for JPEG files

I am newcomer to AppleScript, so I need some help to perform the following actions, on a set of JPEG files, each having the default JPEG icon. I want to replace that default icon by the image preview. So, the script should do the following.

1- Take the whole content of a folder or a selection of its files. Then, for each file,
2- Open the file with a suitable application (Photoshop, GraphicConveter, Preview ?)
3- do “select all”, then copy
4- go back to the finder, do “Get Info” on the file.
5- paste the image in order to set the new icon of the file

Then, all the files of the folder (or at least a selection of the file) would display a preview of each image.

If AppleScript can do that, that would be very useful, because it is tedious to set manually the icon of each file.

Thank you for your answers :confused:

Model: PowerMac G4 2x864 Mhz
AppleScript: AppleScript FU1-1.9.3
Browser: Safari 312.3.1
Operating System: Mac OS X (10.4)

I would point you to the application Pic2Icon (version 1.3), but that site seems to be gone. You can find version 1.2 at download.com.

This may sound obvious, but I wasn’t aware for some time that Finder can display icon previews for JPEGs without modifying their resource data. Just click a window, hit command-1, command-j, and check ‘Show icon preview’ in the resulting window.

That can be slow sometimes. Also, I like adding a drop shadow to the icon.