Hi everyone!
I have just installed Illustrator CS6 and i'm trying to make a script to convert Ai files from a folder to Tif in another folder.
The script is running ok but i have a problem with the LZW compression of the exported Tif.
at the page 62 we have the Tif properties and the following example :
Exporting to TIFF format
// Exports current document to dest as a TIFF file with specified
// options, dest contains the full path including the file name
function exportFileToPSD (dest) {
if ( app.documents.length > 0 ) {
var exportOptions = new ExportOptionsTIFF();
var type = ExportType.TIFF;
var fileSpec = new File(dest);
exportOptions.resolution = 150;
exportOptions.byteOrder = TIFFByteOrder.IBMPC;
exportOptions.IZWCompression = false;
app.activeDocument.exportFile( fileSpec, type, exportOptions );
}
Well the function name seems a nice copy paste from the PSD page but that's not the problem.
The problem is the IZWCompression properties that doesn't work with the value true.
First of all i was thinking that IZW doesn't exist it should be LZW but even with the line exportOptions.LZWCompression = true; it doesn't work too.
Does someone encounter the same problem ?
There you go: http://www.jongware.com/idjshelp.html has been updated to include Illustrator CS6.
Thank you everyone for the answer it's working now like a charm.
I put the example code corrected below for the persons having the same problem :
Exporting to TIFF format
// Exports current document to dest as a TIFF file with specified
// options, dest contains the full path including the file name
function exportFileToTif (dest) {
if ( app.documents.length > 0 ) {
var exportOptions = new ExportOptionsTIFF();
var type = ExportType.TIFF;
var fileSpec = new File(dest);
exportOptions.resolution = 150;
exportOptions.byteOrder = TIFFByteOrder.IBMPC;
exportOptions.lZWCompression = true;
app.activeDocument.exportFile( fileSpec, type, exportOptions );
}
Ps: [Jomgware] i like your site some much nice information in there ![]()
Have a nice day.
More like where one lays down one's arms on the desk and rests one's weary forehead against them.
No better illustration of the internal divisions and strife inside Adobe's programming teams then a good, close look at the Javascript XML files. The differences *almost* outweigh the similarities.
For this one, Illy CS6, I got my enumerations but no classes. Confusion all around, and it took some retro-engineering to find out I had applied a "fix" in my XSLT (for the uninitiated: that's a translation file, in this case from XML to HTML) for a previous run on a different package. It fixed that one but now it didn't work on Illy's file.
One can only wonder how the ESTK itself deals with all those sub-clauses, exceptions, dead links, typo's, and the occasional wrong encoded entry.
North America
Europe, Middle East and Africa
Asia Pacific