Photoshop CS2 slowdown when resizing images through script

I’ve noticed a major slowdown when using a script to tell Photoshop CS2 to resize an image compared to doing it manually in Photoshop.

Has anyone else experienced this?

System: MacPro, 2GHz Dual-Core, 1GB, OS 10.4.10

Lets see your script, because I see a performance increase.

Are you using AppleScript or JavaScript?

I use JavaScript per Adobe’s guidelines, and it’s fast. Annoying, but fast. :wink:

I’m using Applescript.

The whole script is rather long, but here’s the snippet in question. It’s part of a droplet for processing xml files. This part reduces the file size of images for import into a database. I did find an acceptable workaround though. I created two actions, one for horizontal, one for vertical, and call them instead of using resize.

I don’t think the slowdown is elsewhere in the script because I’ve executed this snippet by itself, and it exhibited the slowdown.


									tell application "Adobe Photoshop CS2"
										open alias originalPhotoFile
										if resolution of current document is greater than 199 then
											if photoWidth is greater than photoHeight then
												resize image current document width 1000 resolution 100
											else if photoHeight is equal to photoWidth then
												resize image current document width 1000 resolution 100
											else
												resize image current document height 1000 resolution 100
											end if
										end if
										change mode of the current document to RGB
										save current document in file theNewPhotoFilePath as JPEG with options {class:JPEG save options, embed color profile:false, quality:8} appending lowercase extension with copying
										close current document without saving
									end tell