1 Reply Latest reply on Jan 15, 2014 2:30 AM by Jump_Over

    Change Setting in Active Page

    creativejoan0425 Level 1

      I want to change some setting in a activePage, but when my ActivePage have some overset text, the overset text will not change the setting, others can change the setting, how I also change the overset text setting in activePage

       

      my Script below:

       

       

      ActivePageOnlyforText();

      function ActivePageOnlyforText() {

       

       

          //For Text

            var currentPage = app.activeWindow.activePage; // Find the active page.

              ItemsOnPage = currentPage.allPageItems; // Get the number of items on the page.

              for (var i=0; i<ItemsOnPage.length; i++) // Loop through every item.

              {

              activePageItem = ItemsOnPage[i];

              //Turn off Hyphenation

              try{

               activePageItem.texts.everyItem().appliedLanguage=app.languagesWithVendors.item("English: USA");;

                      }

              catch(myError){

                  }

              //Break Link to Style  

              try{

              activePageItem.texts.everyItem().applyParagraphStyle(app.activeDocument.paragraphStyles.i tem(0), false);

                      }

              catch(myError){

                  }

              try{

              activePageItem.texts.everyItem().applyCharacterStyle(app.activeDocument.characterStyles.i tem(0), false);

                      }

              catch(myError){

                  }

              }

          }

        • 1. Re: Change Setting in Active Page
          Jump_Over Level 5

          Hi,

           

          Assuming your doc is not built with linked frames  - because some of them are overset -

          do your job with stories instead of pageItems - because pageItem.texts excludes overset parts.

           

          I mean replacing inside your try...catch:

          activePageItem.texts.everyItem().....

           

          with this

          activePageItem.parentStory....

           

          Jarek