Copy link to clipboard
Copied
I've just updated my representation of the Scripting DOM API Documentation for InDesign CC 2019.
http://www.indesignjs.de/extendscriptAPI/indesign-latest/
The website supports copy & paste for every text where the copy icon appears while hoovering with the mouse.
You can find a short overview of the DOM here:
http://www.indesignjs.de/auflage2/wp-content/uploads/2015/04/InDesign_Skripting_Kurzreferenz.pdf
If your're looking for offline usage check out the HTML Version https://www.indesignjs.de/extendscriptAPI/indesign14.zip or CHM https://www.indesignjs.de/extendscriptAPI/chm_indesign14.zip
Code Completion for Sublime Text is available here: https://www.indesignjs.de/extendscriptAPI/indesign-latest/jsx.sublime-completions
If there is interest in IntelliSense/VS Code - with your help how to structure IntelliSense Code Completion I will provide that happily.
In case you're interested in the creation process, have a look at the transformations at https://github.com/grefel/extendscriptApiDoc
A big THANK YOU towards jongware who inspired me with his version at http://jongware.mit.edu/ for the work!
Copy link to clipboard
Copied
A CHM version! (But the zip also includes the HTML. As it's also a separate download, perhaps you could remove it from there.)
Copy link to clipboard
Copied
A CHM version! (But the zip also includes the HTML. As it's also a separate download, perhaps you could remove it from there.)
Done. Sorry for that. I don't use CHM and just run a ready made CHM process from oxygen. I hope it works altogether...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Loic.Aigon schrieb
Hi grefel
Thanks for the good work !
Guys, how could we show our gratitude, paypal donation ?
You're welcome. Give the next person a
Copy link to clipboard
Copied
Hi Gregor,
just looked into all the preferences for application.
There is one listed under Objects, LayoutAdjustmentPreference, that cannot be found if I click the link.
Checked with the ESTK running a for x in app loop targetting InDesign CC 2019.
It seems that layoutAdjustmentPreferences is missing in the list of properties that my loop gathered.
My assumptions on that:
There is a new feature named Adjust Layout with CC 2019.
( I'm looking for a way to turn it off by default for the Margins And Columns menu when no document is open. )
It seems that the old Layout Adjustment was dropped with CC 2019 and the new Adjust Layout feature with CC 2019 cannot be controlled with preferences from object app. Checked back with InDesign CC 2018.1 where LayoutAdjustmentPreference is present for object app.
Regards,
Uwe
Copy link to clipboard
Copied
Would that then be the "LayoutRuleOptions"? (A per-page setting; and yes, it has a "LayoutRuleOptions.OFF" member. )
Copy link to clipboard
Copied
Hi Jongware,
just found a new method, unfortunately for documents only:
document.adjustLayout()
Extensively documented with samples.
Hm, layoutRuleOptions is not new.
It's for the Liquid Layout feature that does not correspond with the new Adjust Layout feature.
Regards,
Uwe
Copy link to clipboard
Copied
From the SDK we have SetAutoAdjustMargins, might give you some thing to look for.
P.
Copy link to clipboard
Copied
Hi Pickory,
still I am looking for a preference.
But fear there is no for Adjust Layout.
FWIW: Method adjustLayout() is also for object page.
Searched for setAutoAdjustMargins, but only found property autoAdjustMargins for object PrintBookletOption.
Thanks,
Uwe
Copy link to clipboard
Copied
I think the preference moved here:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#AdjustLayoutPreference.html#d1e328813
Not sure why this needed to be renamed.
Copy link to clipboard
Copied
P.S. Be careful the properties are not exactly the same either, so I suggest checking carefully with hasOwnProperty:
if(myDoc.hasOwnProperty('layoutAdjustmentPreferences')) myDoc.layoutAdjustmentPreferences.enableLayoutAdjustment = false;
if(myDoc.hasOwnProperty('adjustLayoutPreferences')) myDoc.adjustLayoutPreferences.enableAdjustLayout = false;
Note that one is enableLayoutAdjustment and the other is enableAdjustLayout.
Copy link to clipboard
Copied
https://forums.adobe.com/people/Justin+Putney wrote
P.S. Be careful the properties are not exactly the same either, so I suggest checking carefully with hasOwnProperty:
if(myDoc.hasOwnProperty('layoutAdjustmentPreferences')) myDoc.layoutAdjustmentPreferences.enableLayoutAdjustment = false; if(myDoc.hasOwnProperty('adjustLayoutPreferences')) myDoc.adjustLayoutPreferences.enableAdjustLayout = false;
Note that one is enableLayoutAdjustment and the other is enableAdjustLayout.
Hey Justin,
I think that as Uwe said, the old LayoutAdjustment has been removed completely from the InDesign 2019 scripting DOM.
It has been replaced by the new AdjustLayout feature.
I'm not seeing any way of manipulating the old LayoutAdjustment via scripting in 2019.
What's more, the old Layout Adjustment feature seems to have been completely removed from InDesign itself.
Since CC, Layout Adjustment was accessible in 2 places: As a checkbox in the Margins and Columns dialog -- but that was only a checkbox and didn't show any of the available options. Access to the main Layout Adjustment dialog was made difficult to find (on purpose, I think): It was only available through the flyout menu of the (then new) Liquid Layout panel.
Now, in 2019, there is no sign of Layout Adjustment in either of those 2 places at all.
So my conclusion is also that the old Layout Adjustment has been completely removed from InDesign 2019, both from the UI and the scripting DOM, and has been replaced by the new AdjustLayout object.
Time to update some scripts...
Ariel
Copy link to clipboard
Copied
Hi Ariel,
indeed. And unfortunately the new Adjust Layout feature is an unfinished work.
Example:
Have a document with one page and a text frame on page 1.
One column in the frame, one column in the margin guides, just following applied master A that is applied.
Now add a new master B with e.g. two columns and different margins ( screenshots from CC 2018.1 ) where the old Adjust Layout feature is enabled ("Layoutanpassung aktivieren"):
Apply master B to page 1. With CC 2018.1 the text frame on page 1 is following the margins of master B and the new values of the margins:
Not so with CC 2019 version 14.0.0.130!
There is no chance to enable new Adjust Layout feature with masters!
The feature is grayed out. See this screenshot from CC 2019:
The yellow warning triangle says:
"Adjust Layout is not available due to a change in numbers of columns".
The size of the text frame on page 1 and the number of columns of that frame will not follow master B, if master B is applied.
Test that with InDesign CC 2018.1 vs CC 2019.
Regards,
Uwe
Copy link to clipboard
Copied
Yes, I noticed that yellow triangle today.
And also another bug (which I just filed in the prerelease today): The new Adjust Layout doesn't respond, even when turned on, when margins are modified via scripting.
Ariel
Copy link to clipboard
Copied
Hello Ariel
Any news on the Bug report you filed on this?
I miss the ability to script The Adjust Layout a lot!!!
Do you have a link to your bug report so that I can give it a vote or something?
Johan
Copy link to clipboard
Copied
Cheers Uwe!
"document.adjustLayout()
Extensively documented with samples."
...do you have a link to the documentation with samples?
Thank you in advance
Johan
Copy link to clipboard
Copied
Thank you very much, Gregor!
Especially for the chm version.
Regards,
Uwe
Copy link to clipboard
Copied
Oh my…
PS: I tend to use this syntax for checking properties :
if ( !myDoc.properties.layoutAdjustmentPreferences ) …
do the community think hasOwnProperty is preferable ? The only hiccup I found was that properties.prop may lead to false positive as properties.prop may return Number object with value 0 and not undefined. So I end up using typeof… but then I realize this isn't really a gain regarding to hasOwnProperty…
Curious.
Copy link to clipboard
Copied
Querying the properties object can be expensive (slow). That's why I try to avoid it. Every time you reference it, it gathers all the properties of the object (even if you only need to query one).
If I need to use it and I plan do it more than once, I'll store it and reuse it, e.g.,
var props = object.properties;
if(props.prop1)...
if(props.prop2)...
Copy link to clipboard
Copied
I see, thanks a lot Justin.
Copy link to clipboard
Copied
No problem, Loic. 🙂
Copy link to clipboard
Copied
Hi.
My script here was just to convert A4 to Letter. In the past, it was turning on layout adjustments, changing page size and bleed. Easy. Now it makes a mess in the document.
The new "Adjust Layout" button works fine for me, but I couldn't make it work via script. I'm already missing CC 2018...
Luiz
Copy link to clipboard
Copied
Hi Luiz,
I would suggest that you open a new thread about your issues with Adjust Layout.
Provide some code, a test document and some screenshots where we can see what's going wrong.
Thanks,
Uwe Laubender
( ACP )
PS: Oops. I answered a reply from December 2018.
Thought it was a new post from this year. Someone answered as a nested reply somewhere else in this thread.
Copy link to clipboard
Copied
pixelwerk said:
Cheers Uwe!
"document.adjustLayout()
Extensively documented with samples."
...do you have a link to the documentation with samples?
Thank you in advance
Johan
Hi Johan,
see into Gregor's compiled DOM documentation:
https://www.indesignjs.de/extendscriptAPI/indesign14/#Document.html#d1e49265__d1e52193
Regards,
Uwe Laubender
( ACP )