Action Descriptor : adding TIF LZW compression

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Mambo4

Action Descriptor : adding TIF LZW compression

Post by Mambo4 »

I am modifying this function for our art team.
It saves as TIF but does not use any compression.
I need to add that LZW compression to this fucntion.

Code: Select allfunction saveImageTIF(vDepth,desc1,id2) {
   var desc2 = new ActionDescriptor();
   var id181 = charIDToTypeID( "BytO" );
   var id182 = charIDToTypeID( "Pltf" );
   var id183 = charIDToTypeID( "IBMP" );   
   desc2.putEnumerated( id181, id182, id183 );
   var id184 = charIDToTypeID( "TIFF" );
   desc1.putObject( id2, id184, desc2 );
   var idAlpC = charIDToTypeID( "AlpC" );         // Note if this isn't set, TIFF will automatically only save alpha if PSD has one (on CS5)
   var alpC = true
   if (vDepth == 24)
      alpC = false;
    desc1.putBoolean( idAlpC, alpC );
   
   var idLyrs = charIDToTypeID( "Lyrs" );         // no layers
    desc1.putBoolean( idLyrs, false );
       
}

I have not yet used Action Descriptors, so I'm not sure how to add LZW compression to this function.
xbytor

Action Descriptor : adding TIF LZW compression

Post by xbytor »

Try adding this:

Code: Select all        var idLZWC = charIDToTypeID( "LZWC" );
        desc2.putBoolean( idLZWC, true );
Mambo4

Action Descriptor : adding TIF LZW compression

Post by Mambo4 »

thanks!
is there somewhere I cna read up on Action Descriptors, and or all those charIDs & Type IDs?