5 Replies Latest reply on May 3, 2016 8:43 AM by heathkat

    Help finding source of "undefined" error?


      Hello All,

      I wrote a script to export a jpeg from page 1 of an InDesign document. When I run it, I get an error that "jpegOptionsQuality is undefined".  I believe it's referring to the emphasized line in my script below, but I don't see anything wrong with the line or any neighboring lines. Does anyone see my problem?


      I've done a lot of scripting in VB but am fairly new to Javascript.


      Any help is appreciated. :-)




      function MakeJPEGfile() {

        var myDoc = app.activeDocument;


          app.jpegExportPreferences.jpegQuality = jpegOptionsQuality.MAXIMUM;

          app.jpegExportPreferences.exportResolution = 72;

          app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.EXPORT_RANGE;

          app.jpegExportPreferences.pageString = "1";

          app.jpegExportPreferences.jpegQuality = jpegOptionsQuality.HIGH;

          app.jpegExportPreferences.exportResolution = 154;

          app.jpegExportPreferences.jpegColorSpace = jpegColorSpaceEnum.RGB;

          app.jpegExportPreferences.jpegRenderingStyle = jpegOptionsFormat.BASELINE_ENCODING;

          app.jpegExportPreferences.antiAlias = true;

          app.jpegExportPreferences.embedColorProfile = true;



      var myFilePath = myDoc.filePath + "/" + ".jpg"; //export to a folder of the current document

      var myFile = new File(myFilePath);

      myDoc.exportFile(ExportFormat.jpg, myFile, false);