Skip to main content
Participant
January 9, 2026
Question

AdjustLayoutPreference Object Properties Not Working in InDesign 2025 & 2026 Scripts

  • January 9, 2026
  • 2 replies
  • 345 views

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:

var myDocument = app.activeDocument;
try {
myDocument.layoutAdjustmentPreferences.enableLayoutAdjustment=true;
myDocument.layoutAdjustmentPreferences.allowGraphicsToResize=false;
myDocument.layoutAdjustmentPreferences.allowRulerGuidesToMove=false;
myDocument.layoutAdjustmentPreferences.ignoreObjectOrLayerLocks=true;
myDocument.layoutAdjustmentPreferences.ignoreRulerGuideAlignments=true;
myDocument.layoutAdjustmentPreferences.snapZone = 0;
} catch (error) {
myDocument.adjustLayoutPreferences.enableAutoAdjustMargins=true;
myDocument.adjustLayoutPreferences.enableAdjustLayout=true;
myDocument.adjustLayoutPreferences.allowLockedObjectsToAdjust=true;
myDocument.adjustLayoutPreferences.enableAdjustLayout=true;
}
 
Could someone please check and suggest, how to resolve this issue?
Regards,
Mani
 

 

2 replies

rob day
Community Expert
Community Expert
January 10, 2026

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:

 

Screen Shot 9.png

 

Screen Shot 10.png

leo.r
Community Expert
Community Expert
January 10, 2026

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.

Community Expert
January 11, 2026

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 )

rob day
Community Expert
Community Expert
January 11, 2026

Thanks Uwe, I never got past @Manid@SRMI ’s myDocument.layoutAdjustmentPreferences, which is not in the API.