Copy link to clipboard
Copied
When run this script, we have to manually on with right click option on document. Please resolve this.
var myDocument = app.activeDocument;
//Set the document measurement units to points.
myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
//Set up grid preferences.
with(myDocument.gridPreferences){
baselineGridRelativeOption=BaselineGridRelativeOption.TOP_OF_MARGIN_OF_BASELINE_GRID_RELATIVE_OPTION
baselineStart = 14;
baselineDivision = 14;
baselineShown = true;
horizontalGridlineDivision = 14;
horizontalGridSubdivision = 5;
verticalGridlineDivision = 14;
verticalGridSubdivision = 5
documentGridShown =true;
}
change baselineShown = true;
to
baselineGridShown = true;
Vandy
Copy link to clipboard
Copied
Could you please explain clearly...
Vandy
Copy link to clipboard
Copied
This script is for Grid preference. Please see the bolded lines in script. They are true in script. But, after we run the script, we have to check(ON) the show document grid and show Baseline grid in indesign. baselineShown = true and documentGridShown =true do not make result. only If the options are are already shown in document, the grids are appearing. Please explain what is wrong in script.
var myDocument = app.activeDocument;
//Set the document measurement units to points.
myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
//Set up grid preferences.
with(myDocument.gridPreferences){
baselineGridRelativeOption=BaselineGridRelativeOption.TOP_OF_MARGIN_OF_BASELINE_GRID_RELA TIVE_OPTION
baselineStart = 14;
baselineDivision = 14;
baselineShown = true;
horizontalGridlineDivision = 14;
horizontalGridSubdivision = 5;
verticalGridlineDivision = 14;
verticalGridSubdivision = 5
documentGridShown =true;
}
Copy link to clipboard
Copied
change baselineShown = true;
to
baselineGridShown = true;
Vandy
Copy link to clipboard
Copied
Hi,
What is your app.layoutWindows[0].screenMode value after script's run?
Jarek
Copy link to clipboard
Copied
Hm, documentGridShown should work for you, as it works here too. baselineShown cannot work, because it must be baselineGridShown = true;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now