3 Replies Latest reply on May 4, 2017 11:44 PM by Trevorׅ

    Indesign cc2017 page size script

    attil Level 1

      I have this script to generate a page size using variables. If i change the page size, i have to manually run the script. Is there a way to have the script run when i open the document and if i make changes to the sizing? Any help would be greatly appreciated.


      var doc = app.activeDocument;


      doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.inches;


      doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.inches;


      var w = doc.documentPreferences.pageWidth,


          h = doc.documentPreferences.pageHeight,


          pagesize = app.activeDocument.textVariables.itemByName("PageSize");


      pagesize.variableOptions.contents = h + " in X " + w + " in";