Re: PhotoShop CS3 Tiff Save Option
Re: PhotoShop CS3 Tiff Save Option
- Subject: Re: PhotoShop CS3 Tiff Save Option
- From: Stan Cleveland <email@hidden>
- Date: Wed, 15 Jul 2009 16:36:03 -0700
- Thread-topic: PhotoShop CS3 Tiff Save Option
Title: Re: PhotoShop CS3 Tiff Save Option
On 7/15/09 8:06 AM, "Steven Valenti" wrote:
In PhotoShop CS3 I'm trying to save a tiff with the option to not save as layers which wont work for me.
Can anyone who runs CS3 confirm this for me? Having an open document in CS3 with more than one layer I'm running this script...
tell application "Adobe Photoshop CS3"
save current document in ((path to desktop as string) & "Test.tif") as TIFF ¬
appending no extension with options {save layers:false} with copying
end tell
I can flatten the document before save but how can I then undo it?
Thanks for any help!!!
Hi Steven,
At times, one must resort to _javascript_ to get Photoshop to behave. Below is the handler I wrote a few years ago for doing a TIFF “save as.” You’ll see that there are several options, including whether to save layers.
It still seems to work fine, even when saving over the original TIFF file. YMMV, so test to verify that everything is working as you expect. Also, since there’s minimal error trapping, be sure you actually have an open file to save, that it has an appropriate color space, etc.
HTH,
Stan C.
set savePath to "Macintosh HD:Users:stanc:Desktop:TestFile.tif"
set savePathInvalid to saveTIFF(savePath, true, true, false, false)
if savePathInvalid then
-- handle error here
end if
(************************* HANDLER FOLLOWS *************************)
on saveTIFF(savePath, usingLZW, withCopying, alphaChannels, savingLayers)
set savePathInvalid to false -- default value
-- select clipping path via _javascript_
tell application "Adobe Photoshop CS3"
activate
try
do _javascript_ ("function saveTIFF(savePath)
{
var formatParameters = new ActionDescriptor();
formatParameters.putEnumerated( charIDToTypeID( \"BytO\" ), charIDToTypeID( \"Pltf\" ), charIDToTypeID( \"IBMP\" ) );
formatParameters.putBoolean( charIDToTypeID( \"LZWC\" ), " & (usingLZW as text) & " );
var saveParameters = new ActionDescriptor();
saveParameters.putObject( charIDToTypeID( \"As \" ), charIDToTypeID( \"TIFF\" ), formatParameters );
saveParameters.putPath( charIDToTypeID( \"In \" ), new File( savePath ) );
saveParameters.putBoolean( charIDToTypeID( \"Cpy \" ), " & (withCopying as text) & " );
saveParameters.putBoolean( charIDToTypeID( \"AlpC\" ), " & (alphaChannels as text) & " );
saveParameters.putBoolean( charIDToTypeID( \"Lyrs\" ), " & (savingLayers as text) & " );
executeAction( charIDToTypeID( \"save\" ), saveParameters, DialogModes.NO );
}
saveTIFF( arguments[0] );") with arguments {savePath}
on error number 4251 -- path to target does not exist
set savePathInvalid to true
end try
end tell
return savePathInvalid
end saveTIFF
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden