3 Replies Latest reply on May 17, 2011 8:27 AM by BeriliaTubul

    [js] menuAction corresponding to Cmd-Shift-Click

    BeriliaTubul Level 1

      Hi,

       

      I need to now wich menuAction use to add a "block of text". (my inDesign is in French so it may not be "block of text" but it corresponds to the javascript object TextFrame)

       

      For exemple, to add a page I do this :

      app.menuActions.itemByID(24346).invoke();

       

      Which id correspond to the action Cmd-Shift-Click ?

        • 1. Re: [js] menuAction corresponding to Cmd-Shift-Click
          [Jongware] Most Valuable Participant

          Uh, what is the reason you want to stick to menu actions, instead of immediately doing a simple

           

          app.activeDocument.pages.add(LocationOptions.AT_END);

           

          to add a page?

           

          (Because the answer you are looking for is a command, not something that can be found in a menu: (any_master_page_item).override(destinationPage);

           

          "Overrides a master page item and places the item on the document page as a new object.")

          • 2. Re: [js] menuAction corresponding to Cmd-Shift-Click
            BeriliaTubul Level 1

            Well,

             

            For now, I'm doing this :

            var myNewPage = myDocument.pages.add();            

            if (myNewPage.side == PageSideOptions.rightHand) {

                 var left = leftPair;

                 var right = rightPair;

            }

            else {

                 var left = leftImpair;

                 var right = rightImpair;

            }

            // Fait le lien entre les 2 pages (la parécédente et celle venant d'être créée)

            var myTextFrameC = myNewPage.textFrames.add({geometricBounds:[top, left, bottom, right]});

            myTextFrameC.previousTextFrame = myDocument.pages.item(i-1).textFrames.item(0);

            And this for every page :  while(myDocument.pages.lastItem().textFrames.item(0).overflows)

             

            But I need top, left, bottom and right.

             

            With invoke, I won't need all this (which can avoid mistakes).

             

            Also, when we have an overflow, we can "take" it (clicking on the red square) and place it on the next text frame while clicking on shift. It will had all : pages, text frames... as long as we need.

             

            You're telling me I can't do that (this easy) in javascript?

             

            I don't understand this :

            (any_master_page_item).override(destinationPage);

            • 3. Re: [js] menuAction corresponding to Cmd-Shift-Click
              BeriliaTubul Level 1

              Hi,

               

              Forget all I've said.

               

              The only thing I need, is to know if it is possible to flow text automatically

              (like here : http://help.adobe.com/en_US/indesign/cs/using/WSa285fff53dea4f8617383751001ea8cb3f-6f99a.h tml#WSa285fff53dea4f8617383751001ea8cb3f-6f8ea)

              but using javascript.

               

              Maybe there is a way to say "I want the text to start here" without clicking?

               

              Hope someone will help me whit that.