Search code examples
javascriptexportadobe-indesignextendscript

InDesign CS5 / Extendscript -- What are the parameters for exportFile, and what are its' related properties?


There is very poor documentation on Extendscript for InDesign online, and I otherwise cannot find any detailed / useful information on the exportFile method... this is all I could find, which is fairly well garbled:   http://jongware.mit.edu/idcs5/pe_ExportFormat.html.


A common such statement I have seen using exportFile would be:

       imgs[i].exportFile(ExportFormat.JPG, img, false).

This statement uses the JPG property of ExportFormat, is passing a file object img, and is passing the parameter false.

I know that the file object has to be instantiated in such a way:

       var img = new File(folder + "/" + fileName).

...but WTF is false for?

Also, it seems as if different file-type properties for the ExportFormat object are instantiated in different ways... For instance, I have seen a PDF's ExportFormat to be instantiated as ExportFormat.pdfType. This variation throws me off, and other file-types seem to have unique property names as well.


So, what exactly are the parameters for the exportFile method, and what are all of the properties of these parameters?


Solution

  • I think resources are quite numerous if you where to find them ;) I really advise you having this bookmark as a favourite : http://jongware.mit.edu/idcs5js_html_3.0.3i/idcs5js/

    Once that done, navigate to the pageItem ( Layout ) link and see for exportFile method :

    void exportFile (format: varies, to: File[, showingOptions: bool=false][, using: PDFExportPreset][, versionComments: string][, forceSave: bool=false]) Exports the object(s) to a file.

    the false means you do not want to use a PDF Export Preset.

    Loic