When using the save command there are a number of specifiable options. These options are
grouped by file type in the provided save options classes. Because the type and contents of the
file you are working on affects how it is saved, some of the option values may not always be
applicable. It also means that many of the option values do not have well defined default
values.
The best way to determine what values can or should be used for save is to perform a save
command from the user interface and then copy the value from the options dialog to your
script. You should perform a complete save operation because there can be multiple dialogs
presented before the document is saved. If you cancel one of the save dialogs without
completing the operation you could miss a dialog containing values needed in your script.
There are many objects that allow you to specify how you want to save your document. For
example, to save a file as a JPEG file, you would use the JPEG save options
(JPEGSaveOptions/JPEGSaveOptions) class as shown below.
AS:
tell application "Adobe Photoshop CS"
end tell
VB:
Dim appRef As New Photoshop.Application
Set jpgSaveOptions = CreateObject("Photoshop.JPEGSaveOptions")
jpgSaveOptions.EmbedColorProfile = True
jpgSaveOptions.FormatOptions = psStandardBaseline
jpgSaveOptions.Matte = psNoMatte
jpgSaveOptions.Quality = 1
appRef.ActiveDocument.SaveAs "c:\temp\myFile2", _
Photoshop CS Scripting Guide
make new document
set myOptions to {class:JPEG save options, ¬
embed color profile:false, format options: standard, ¬
matte: background color matte,}
save current document in file myFile as JPEG with options ¬
myOptions appending no extension without copying
Options:=jpgSaveOptions, _
asCopy:=True, extensionType:=psLowercase
Scripting Photoshop
Document object
3
69