20 Replies Latest reply on Dec 11, 2018 2:13 AM by luixsilveirassi

    [ANN] InDesign CC 2019 DOM API Docs

    grefel Level 2

      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_Kurzrefere nz.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!

        • 1. Re: [ANN] InDesign CC 2019 DOM API Docs
          [Jongware] Most Valuable Participant

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

          • 2. Re: [ANN] InDesign CC 2019 DOM API Docs
            Loic.Aigon Adobe Community Professional

            Hi grefel

             

            Thanks for the good work !

             

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

            • 3. Re: [ANN] InDesign CC 2019 DOM API Docs
              Laubender Adobe Community Professional & MVP

              Thank you very much, Gregor!

              Especially for the chm version.

               

              Regards,
              Uwe

              • 4. Re: [ANN] InDesign CC 2019 DOM API Docs
                grefel Level 2

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

                • 5. Re: [ANN] InDesign CC 2019 DOM API Docs
                  grefel Level 2

                  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

                  • 6. Re: [ANN] InDesign CC 2019 DOM API Docs
                    Laubender Adobe Community Professional & MVP

                    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

                    1 person found this helpful
                    • 7. Re: [ANN] InDesign CC 2019 DOM API Docs
                      [Jongware] Most Valuable Participant

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

                      • 8. Re: [ANN] InDesign CC 2019 DOM API Docs
                        Laubender Adobe Community Professional & MVP

                        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

                        • 9. Re: [ANN] InDesign CC 2019 DOM API Docs
                          Pickory Level 4

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

                           

                          P.

                          • 10. Re: [ANN] InDesign CC 2019 DOM API Docs
                            Laubender Adobe Community Professional & MVP

                            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

                            • 12. Re: [ANN] InDesign CC 2019 DOM API Docs
                              Justin Putney Level 2

                              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.

                               

                               

                              1 person found this helpful
                              • 13. Re: [ANN] InDesign CC 2019 DOM API Docs
                                Loic.Aigon Adobe Community Professional

                                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.

                                • 14. Re: [ANN] InDesign CC 2019 DOM API Docs
                                  Justin Putney Level 2

                                  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)...
                                  
                                  • 15. Re: [ANN] InDesign CC 2019 DOM API Docs
                                    Loic.Aigon Adobe Community Professional

                                    I see, thanks a lot Justin.

                                    • 16. Re: [ANN] InDesign CC 2019 DOM API Docs
                                      Justin Putney Level 2

                                      No problem, Loic. :-)

                                      • 17. Re: [ANN] InDesign CC 2019 DOM API Docs
                                        TᴀW Adobe Community Professional & MVP

                                        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

                                        • 18. Re: [ANN] InDesign CC 2019 DOM API Docs
                                          Laubender Adobe Community Professional & MVP

                                          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

                                          • 19. Re: [ANN] InDesign CC 2019 DOM API Docs
                                            TᴀW Adobe Community Professional & MVP

                                            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

                                            • 20. Re: [ANN] InDesign CC 2019 DOM API Docs
                                              luixsilveirassi Level 1

                                              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