Copy link to clipboard
Copied
Hi All,
I am using Indesign 2025 and 2026; I would like to enable the "Adjust Layout" option in my documents through the Indesign scripting by using "AdjustLayoutPreference" object properties as in InDesign ExtendScript API, but Indesign throwed error is "Eval Error (#55): "Object does not support the property or method 'adjustLayoutPreferences'".
below is my code:
Copy link to clipboard
Copied
For starters, there's no layoutAdjustmentPreferences property, so you can discard that part already:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Document.html
I know you're getting the error in the catch part, but I'm not sure yet why.
Copy link to clipboard
Copied
Hi @leo.r ,
well, indeed, according to the DOM documentation there are adjustLayoutPreferences:
https://www.indesignjs.de/extendscriptAPI/indesign21/#AdjustLayoutPreference.html
To make them work you first have to enable them:
myDocument.adjustLayoutPreferences.enableAdjustLayout = true;
Perhaps this is working as well:
myDocument.adjustLayoutPreferences.properties =
{
enableAdjustLayout : true,
enableAutoAdjustMargins : true,
allowLockedObjectsToAdjust : true
};
Kind regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Thanks Uwe, I never got past Manid@SRMI ’s myDocument.layoutAdjustmentPreferences, which is not in the API.
Copy link to clipboard
Copied
Hi Manid@SRMI , Is this an AI generated script? AI likes to make up methods.
Not sure if this helps, but there is an adjustLayout() method which handles some layout adjustments:
var doc = app.activeDocument;
//width and height parameters take points
doc.adjustLayout({width:800, height:800,leftMargin: 20, rightMargin: 20, topMargin: 20, bottomMargin: 20, bleedTop:30, bleedBottom:30, bleedInside:30, bleedOutside:30})
Before and after:
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more