Copy link to clipboard
Copied
Hello, I was very kindly helped out with the below script (using a text variable) which displays the size of the current page within an InDesign document.
The result it gives is based on the Document Setup, and I was wondering if it was possible to amend it to base the result on the Page Size instead (as you can now change the page size independently of the Document Setup within InDesign using the Page Tool). I don't know anything about scripting by the way!
Many thanks in advance for any help.
var doc = app.activeDocument;
doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.millimeters;
doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.millimeters;
var w = doc.documentPreferences.pageWidth,
h = doc.documentPreferences.pageHeight,
pagesize = app.activeDocument.textVariables.itemByName("PageSize");
pagesize.variableOptions.contents = h + " mm X " + w + " mm";
Try this,
var doc = app.activeDocument;
doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.millimeters;
doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.millimeters;
for(var i =0;i<doc.pages.length;i++)
{
alert("Page Width : " + doc.pages.bounds[3] + "\rPage Height : " + doc.pages.bounds[2] )
}
Regards,
Chinna
Forgot to mention - thanks to the ObjectStyle - you can set your own properties, including ParaStyle to format text.
Copy link to clipboard
Copied
Forgot to mention - thanks to the ObjectStyle - you can set your own properties, including ParaStyle to format text.
Copy link to clipboard
Copied
wowwwww
thats perfect
thank you very much
you helped me so much
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more