Add layoutWindows[0].properties to document.properties by script
I would like to set different properties by script, like rulerOrigin, zoomPercentage and so on.
The properties I want to set are in different positions in the object model.
If I set them individually for each node in the object model (does this make sense?), it works as expected:
var doc = app.documents[0];
doc.viewPreferences.properties = {
rulerOrigin: RulerOrigin.PAGE_ORIGIN,
}
doc.layoutWindows[0].properties = {
zoomPercentage: 100,
}
However, it would be more elegant, do put everything in doc.properties like so:
doc.properties = {
viewPreferences: {
rulerOrigin: RulerOrigin.PAGE_ORIGIN,
}
}
Unfortunately, I can’t figure out, how to add doc.layoutWindows[0].
The following code doesn’t work:
doc.properties = {
viewPreferences: {
showFrameEdges: true,
},
layoutWindows.item(0): {
zoomPercentage: 100,
}
}
Any idea, how this is done?
---
By the way: I’m not sure what layoutWindows[0] actually refers to.
I guess it is meant to distinguish between multiple views of the same document. Am I right here?
Regards, Martin
