Skip navigation
DikVin
Currently Being Moderated

Javascript : Ai Conversion to Tif Bug

Nov 23, 2012 4:37 AM

Tags: #illustrator #javascript #cs6 #tif #lzw #ai

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.

 

in the doc :  http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/p df/illustrator/scripting/cs6/Illustrator-Scripting-Reference-JavaScrip t.pdf

 

 

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 ?

 
Replies
  • Currently Being Moderated
    Nov 23, 2012 10:23 AM   in reply to DikVin

    The character in question (lZWCompression) is a lowercase L (l). It is similar in usage to the pDFPreset where the first letter is lower case. It is shown as an uppercase I in the documentation which is wrong.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 23, 2012 12:08 PM   in reply to Larry G. Schneider

    The fact that they call a function exportFileToPSD when it exports tiff makes me smile… In the doc I have it's slab-serif and clearly an I not an l… Gone are the days of RTFM because its offen wrong… Still only a tarted up CS5 doc missing half the info…

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 23, 2012 2:18 PM   in reply to Muppet Mark

    Um, should I go look into making a Friendly CHM version this weekend?

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 24, 2012 9:00 AM   in reply to [Jongware]

    Jongware, you got CS6…? Would it include all the new app features… If so it will be going in with my others TVM…

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 25, 2012 5:34 AM   in reply to Muppet Mark

    There you go: http://www.jongware.com/idjshelp.html has been updated to include Illustrator CS6.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 26, 2012 4:18 AM   in reply to [Jongware]

    And a photoshop one too (hum snuck on 2 moths ago!). wow almost a full collection now…

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 26, 2012 5:39 AM   in reply to Muppet Mark

    Muppet, you also venture into Photoshop scripting? Then I'll (*sigh*) take a look at adding the ref for PS CS6 as well. I see the only one I got at the moment is CS5, for reasons Unknown.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 26, 2012 6:57 AM   in reply to [Jongware]

    yup… and a little bridge (not the game)… TVM

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 26, 2012 9:01 AM   in reply to [Jongware]

    Is that "sigh" with a proper wrist to the forehead, Jongware?

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 26, 2012 10:30 AM   in reply to Larry G. Schneider

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 26, 2012 11:29 AM   in reply to [Jongware]

    Same functionality and you didn't even get Thanskgiving to rest up.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points