currently i am using Indesign CC 2014.what happens if we dont use myDoc.layoutWindows ??
Do you have a coding guidelines or online documentation which might help you in this case? Does this also give same exception in the tool or this is server's behavior?
InDesign Server does not have UI elements, so there's no windows to address. You should be addressing the documents directly. There's no reason to be using windows on InDesign Server.
Hi is there any workaround to fix that in jsx as the components in the documents are getting disordered.
Why does the script use layoutWindows? You should address the document using app.documents.item(item);
It uses layoutWindow for scaling and restoring the settings
ex - var oldRefPoint = myDoc.layoutWindows.transformReferencePoint;
myDoc.layoutWindows.transformReferencePoint = AnchorPoint.CENTER_ANCHOR; // for scaling
myFrame.verticalScale = scaleFactor;
myFrame.horizontalScale = scaleFactor;
myDoc.layoutWindows.transformReferencePoint = oldRefPoint; // restore this setting
There's no way to specify that in InDesign Server.
There's two ways to handle this:
1) You can move the object to the correct position after scaling it.
2) You can use the transform() method for scaling which accepts an argument for the reference point.
My choice would be option 2.