1 Reply Latest reply on Jan 28, 2015 5:57 AM by Laubender

    How to apply script on text in tables

    ayeletf39178048

      I have a script that changes few characters' settings, but when I run it, it doesn't work on text in tables.

      This is the script:

       

      Application.prototype.main=function()

      {

        if(this.documents.length>0)

        {

        var myDoc= this.activeDocument;

               //changing composer, language and Para direction

        myDoc.stories.everyItem().composer = "Adobe World-Ready Paragraph Composer";

              myDoc.stories.everyItem().appliedLanguage = app.languagesWithVendors.item("Hebrew");

              myDoc.stories.everyItem().paragraphDirection = ParagraphDirectionOptions.rightToLeftDirection;

              myDoc.stories.everyItem().hyphenation = false;

              myDoc.stories.everyItem().characterDirection = CharacterDirectionOptions.defaultDirection;

              myDoc.stories.everyItem().keyboardDirection = 1147496036;

              allTablesContents.composer = "Adobe World-Ready Paragraph Composer";

       

       

      Thanks

        • 1. Re: How to apply script on text in tables
          Laubender Adobe Community Professional & MVP

          You have to address the text in table cells in a second step.

          Also footnotes or cells in nested tables.

           

          Example for all NOT nested tables:

           

          var allNOTnestedTables = app.documents[0].stories.everyItem().tables.everyItem().cells.everyItem().texts[0];
          allNOTnestedTables.composer = "Adobe World-Ready Paragraph Composer";
          

           

          NOTE:

          Instead of using the string "Adobe World-Ready Paragraph Composer" better use the locale independent string:
          "$ID/HL Composer Optyca".

           

          Even better: Change the applied paragraph styles and character styles.

          Never change paragraphStyles[0] and paragraphStyles[1] !!!

           

          Why do you expand the Application object with prototype.main ?

           

          Uwe