Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
3

[ANN] InDesign CC 2019 DOM API Docs

Community Expert ,
Oct 18, 2018 Oct 18, 2018

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!

TOPICS
Scripting
5.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2018 Oct 18, 2018

A CHM version! (But the zip also includes the HTML. As it's also a separate download, perhaps you could remove it from there.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2018 Oct 18, 2018

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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 18, 2018 Oct 18, 2018

Hi grefel

Thanks for the good work !

Guys, how could we show our gratitude, paypal donation ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2018 Oct 18, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2018 Oct 18, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2018 Oct 18, 2018

Would that then be the "LayoutRuleOptions"? (A per-page setting; and yes, it has a "LayoutRuleOptions.OFF" member. )

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2018 Oct 18, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 18, 2018 Oct 18, 2018

From the SDK we have SetAutoAdjustMargins, might give you some thing to look for.

P.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2018 Oct 18, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 05, 2018 Nov 05, 2018

I think the preference moved here:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#AdjustLayoutPreference.html#d1e328813

Not sure why this needed to be renamed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 05, 2018 Nov 05, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 11, 2018 Nov 11, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2018 Nov 11, 2018

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"):

Master-B-TwoColumns-DifferentMargins-LayoutAdjustmentApplied.PNG

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:

Master-B-AppliedToPage1.png

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:

AdjustLayoutIsNotAvailable-Cause-ChangeOfNumberOfColumns.png

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 11, 2018 Nov 11, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2019 Nov 04, 2019

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2019 Nov 04, 2019

Cheers Uwe!
"document.adjustLayout()

Extensively documented with samples."

...do you have a link to the documentation with samples?
Thank you in advance
Johan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2018 Oct 18, 2018

Thank you very much, Gregor!

Especially for the chm version.

Regards,
Uwe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 06, 2018 Nov 06, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 06, 2018 Nov 06, 2018

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)...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 06, 2018 Nov 06, 2018

I see, thanks a lot Justin.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 06, 2018 Nov 06, 2018

No problem, Loic. 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 11, 2018 Dec 11, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2019 Nov 05, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2019 Nov 05, 2019
LATEST

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 )

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines