Copy link to clipboard
Copied
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";
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thanks, so much for the help, Trevor. Just one more question. How can i add a Bleed/Live size variable? I don't think it was answered in the post.
Copy link to clipboard
Copied
Point #3 of the first link (I need to add in a page size text variable to my already working .jsx script )