0
Setting Baseline Preferences
New Here
,
/t5/indesign-discussions/setting-baseline-preferences/td-p/1162567
Jul 02, 2008
Jul 02, 2008
Copy link to clipboard
Copied
I'm stuck. I need to reset the baseline grid for a specific document and I'd like to read the current preferences and then adjust them to one of two different preferences.
I can create a script which reads and sets the preferences for a document, but it doesn't change what is displayed or what is stored in the InDesign Preferences, Grid location.
Does anyone have an idea what I need to change. When I try to review the documentation, it says that the baselineFrameGridOption as a preference is read only, but for a document it is read/write. What do I do?
TIA,
Warren Bingham
Here's my small little script. No if statements yet, I'm just trying to get it to switch the baseline grid.
if (app.documents.length != 0){
var myDoc = app.documents.item(0)
}
else{
alert ("Please open a document and try again.");
}
var gridOptions = myDoc.baselineFrameGridOptions;
gridOptions.useCustomBaselineFrameGrid= true
gridOptions.baselineFrameGridIncrement = 10.25
gridOptions.startingOffsetForBaselineFrameGrid = 59
I can create a script which reads and sets the preferences for a document, but it doesn't change what is displayed or what is stored in the InDesign Preferences, Grid location.
Does anyone have an idea what I need to change. When I try to review the documentation, it says that the baselineFrameGridOption as a preference is read only, but for a document it is read/write. What do I do?
TIA,
Warren Bingham
Here's my small little script. No if statements yet, I'm just trying to get it to switch the baseline grid.
if (app.documents.length != 0){
var myDoc = app.documents.item(0)
}
else{
alert ("Please open a document and try again.");
}
var gridOptions = myDoc.baselineFrameGridOptions;
gridOptions.useCustomBaselineFrameGrid= true
gridOptions.baselineFrameGridIncrement = 10.25
gridOptions.startingOffsetForBaselineFrameGrid = 59
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
4
Replies
4
Participant
,
/t5/indesign-discussions/setting-baseline-preferences/m-p/1162568#M275927
Jul 02, 2008
Jul 02, 2008
Copy link to clipboard
Copied
At the moment, all I can confirm is that I get the same results as you. The script seems to work if you interrogate the values in ESTK, but the values don't seem to be reflected in the UI.
Dave
Dave
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Warren Bingham
AUTHOR
New Here
,
/t5/indesign-discussions/setting-baseline-preferences/m-p/1162569#M275928
Jul 07, 2008
Jul 07, 2008
Copy link to clipboard
Copied
The only way I got it to work was to work with the gridPreferences for the document instead of the application. My final script just toggles between two different leading grids.
Thanks,
Warren Bingham
The script:
if (app.documents.length != 0){
var myDoc = app.documents.item(0)
}
else{
alert ("Please open a document and try again.");
}
var gridPrefs = myDoc.gridPreferences;
var bStart = gridPrefs.baselineStart + ''
var bStartSplit = bStart.split(".")
var bStartPicas = bStartSplit[0]
var bStartPoints = ("." + bStartSplit[1])*12
var bStartMeasured = bStartPicas + "p" + bStartPoints
if (bStartMeasured == '4p11')
{ myDoc.gridPreferences.baselineStart = '15p2.25'
myDoc.gridPreferences.baselineDivision= '0p10.25'
}
else
{ myDoc.gridPreferences.baselineStart = '4p11'
myDoc.gridPreferences.baselineDivision= '0p10.25'
}
Thanks,
Warren Bingham
The script:
if (app.documents.length != 0){
var myDoc = app.documents.item(0)
}
else{
alert ("Please open a document and try again.");
}
var gridPrefs = myDoc.gridPreferences;
var bStart = gridPrefs.baselineStart + ''
var bStartSplit = bStart.split(".")
var bStartPicas = bStartSplit[0]
var bStartPoints = ("." + bStartSplit[1])*12
var bStartMeasured = bStartPicas + "p" + bStartPoints
if (bStartMeasured == '4p11')
{ myDoc.gridPreferences.baselineStart = '15p2.25'
myDoc.gridPreferences.baselineDivision= '0p10.25'
}
else
{ myDoc.gridPreferences.baselineStart = '4p11'
myDoc.gridPreferences.baselineDivision= '0p10.25'
}
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/indesign-discussions/setting-baseline-preferences/m-p/1162570#M275929
Jul 07, 2008
Jul 07, 2008
Copy link to clipboard
Copied
Hi Warren,
Grid preferences for the document is the right place to do what you want to do. When you set grid preferences for the application, it will affect all new documents, but leaves existing documents unchanged.
This is exactly how preferences work in the user interface--make changes with no document open, and you're setting application preferences; make changes in a document with nothing selected, and you're setting document preferences.
Thanks,
Ole
Grid preferences for the document is the right place to do what you want to do. When you set grid preferences for the application, it will affect all new documents, but leaves existing documents unchanged.
This is exactly how preferences work in the user interface--make changes with no document open, and you're setting application preferences; make changes in a document with nothing selected, and you're setting document preferences.
Thanks,
Ole
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Warren Bingham
AUTHOR
New Here
,
LATEST
/t5/indesign-discussions/setting-baseline-preferences/m-p/1162571#M275930
Jul 11, 2008
Jul 11, 2008
Copy link to clipboard
Copied
So if I did not have a document open, then the changes would have taken effect of new documents created, but not on existing documents that were opened?
Thanks,
Warren
Thanks,
Warren
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more