Photoshop CS2 save for web

Can’t for the life of me figure out how the save for web options work in Photoshop CS2:

export theDoc in file theFilePath as save for web with options {class:save for web export options, format:JPEG, quality:80}

Sombody pleeeeeease help. It’s driving me mad!! :mad:

using a combo of adobe supplied script and the coding above, the following should work, but does not. Can anybody help me out as to why? The message I receive is:

"AppleScript Error: Adobe Photoshop CS2 got an error: Can’t get document “Untitiled-1”

tell application "Finder" to set theFilePath to (home as string) & "Desktop:test2.jpg"
tell application "Adobe Photoshop CS2"
	make new document
	set theDoc to current document
	export theDoc in file theFilePath as save for web with options {class:save for web export options, format:JPEG, quality:80}
end tell

ANY help would be greatly appreciated.

Steve

I can get this much to work:

export theDoc in file theFilePath as save for web with options {class:save for web export options, optimized size:true, quality:80, with profile:false}

That works but it saves as a GIF (the default). Adding the “format:JPEG” causes an error. I believe this is a bug since I have tried it from every angle and can’t get it to save as a JPEG.

My solution was to trigger the “Edit in ImageReady” menu item with System Events (I am in Mac OS 10.3.9 in CS2). In ImageReady, you can record an Action that sets the format as JPEG and the target file size in the “Optimize” palette. You can then trigger the action in your script. Here is my code. You will have to adapt it a bit I am sure, but this is the main part you will need.

–Once you are already in PhotoShop with the image open:
tell application “System Events”
pick menu item “Edit in ImageReady” of menu “File” of menu bar item “File” of menu bar 1 of process “Adobe Photoshop CS2”
end tell
delay 2

tell application "Adobe ImageReady CS2"
	activate
	delay 3
	do script "NameOfAction"
end tell

tell application "System Events"
	pick menu item "Save Optimized As..." of menu "File" of menu bar item "File" of menu bar 1 of process "Adobe ImageReady CS2"
	delay 1
	key down command
	keystroke "d"  --sets the path to the desktop
	key up command
	keystroke ("Name of file" & return)
	delay 3
	key down command
	keystroke "w"  --Closes document after saving
	delay 2
	keystroke "d"  --selects don't save at prompt
	key up command
end tell

Model: Mac G5
Operating System: Mac OS X (10.3.9)

I have the same problem, so I find this topic here. But to save changes with “Remember” doesnot works correctly some times. So I made an Applescript app and a PhotoShop action, see < https://hahn-mediaservice.net/private/Gast/ >. Click on “Downloadbereich” and choose folder “export_options_save_for_web”.

I hope this help.

Ok,
here’s a solution,


set myExportOptions to {as:JPEG, quality:40}
export in file (new_name & BDM_file) as save for web with options myExportOptions

the problem is that during redaction, applescript editor won’t allow you to compile {as:JPEG} ! :confused:
The trick is to use “«class fltp»” instead of “as”.

We write :


set myExportOptions to {«class fltp»:JPEG, quality:40}
export in file (new_name & BDM_file) as save for web with options myExportOptions

After compilation everything works for me.

Igor

:cool:

Post scriptum : Apple script editor 2.1.1 won’t let you save the file, use instead the older 2.0 version

Browser: Firefox 1.0.7
Operating System: Mac OS X (10.4.7)

In case anyone was wondering, in PhotoShop CS3 the save for web bug is fixed. The syntax is slightly different.

export current document in file (MyPathAndFileName & ".jpg") as save for web with options {web format:JPEG, optimized size:true, quality:40, with profile:false}

Model: G5 OSX 10.4.8
Browser: Safari 419.3
Operating System: Mac OS X (10.4)