Margin Preferences Scripting Exception Or Bug?
Hi Everyone,
I am stuck here. I am confused whether it is a bug or I misunderstood.
When I am changing margin preferences of individual pages the code works. But when I am trying to change margin preferences of all pages at once then code doesn't work.
This code works:
for(var i = 0; i < app.documents[0].pages.length; i++){
app.documents[0].pages[i].marginPreferences.left = 12;
app.documents[0].pages[i].marginPreferences.right = 12;
app.documents[0].pages[i].marginPreferences.top = 12;
app.documents[0].pages[i].marginPreferences.bottom = 12;
}
& This code doesn't work:
app.documents[0].pages.everyItem().marginPreferences.left = 12;
app.documents[0].pages.everyItem().marginPreferences.right = 12;
app.documents[0].pages.everyItem().marginPreferences.top = 12;
app.documents[0].pages.everyItem().marginPreferences.bottom = 12;
And there is one more point to mention:
I can access margin preference of document like :
app.documents[0].marginPreferences.left = 12;
app.documents[0].marginPreferences.right = 12;
app.documents[0].marginPreferences.top = 12;
app.documents[0].marginPreferences.bottom = 12;
But I am not able to access these :
app.documents[0].marginPreferences.columnCount = 2;
app.documents[0].marginPreferences.columnGutter = 25;
I need to understand whether this has to do with any specific version of InDesign or is there any limitation or any other reason.
Please guide me on this.
I am using Windows OS & InDesign CC 2019.
Thanks
Sunil