6 Replies Latest reply on Jul 23, 2012 4:27 AM by snegig

    How to move marginalnote out in Structure

    snegig Level 1

      Hi Scripting guru,

       

      I want my all marginalnote move out in Structure. When marginalnote move in page margin my test from 11p text width. You have any script code. Please accept my sincere apology for take your golden time.

       

      Screen shot 2012-07-22 at 5.44.26 PM.png

       

      Thanks and have a nice day!

        • 1. Re: How to move marginalnote out in Structure
          csm_phil Level 4

          Hi,

           

          I hope you need place the marginal note has an anchored object? If yes, you can use the below JS code.

           

          If you post any requirements in the forum please post what you have tried in you end in Java script. Then only some one help to easily. Otherwise is so difficults. Your most of the post always simply shown the snapshots only please place the JS code in your future post.

           

          var mydoc = app.activeDocument;
          var rootElement = mydoc.xmlElements.item(0);
          var linkElementList = rootElement.evaluateXPathExpression("//marginalnote[@type='mn1']");
          for(var lp=0; lp=linkElementList.length; lp++){
                  var myElement = linkElementList[lp];
                          var myTextframe = myElement.placeIntoInlineFrame(["21p9","5p"]);
                         //you have create the object style in you document name is "MN"; 
                          myTextframe.appliedObjectStyle= mydoc.objectStyles.item("MN");
              }
          alert("Proces Completed");
          

           

           

          thx

          csm_phil

          1 person found this helpful
          • 2. Re: How to move marginalnote out in Structure
            snegig Level 1

            Hi sir,

            Please accept my sincere apology for this and I will make sure this will not happen again. I need your help once again, sir we want, marginal note place in simple text frame with apply “MN” object style in place miner column. When we have run script code show err. We have alredy creat “MN” Object style in .indd files.

             

            Screen shot 2012-07-23 at 9.54.28 AM.png

            Thanks !!!

            • 3. Re: How to move marginalnote out in Structure
              ramkumar.vp Level 3

              Do you want to untag the "marginalnote" element from structure pane or move to the root element?

               

              Requirement not clear...

              • 4. Re: How to move marginalnote out in Structure
                snegig Level 1

                Hi,

                We want “marginalnote“ text (drag out of structure) move in new separate text fram in my .indd file in marginal column. And apply “MN” object style.

                 

                XML Structure as it only “marginalnote” text move new text frame with apply “MN“ object style.

                thanks!!!

                • 5. Re: How to move marginalnote out in Structure
                  csm_phil Level 4

                  Hi Sneig,

                   

                  I have modifed the above JS code. Please try this.

                  If your document have only one marginal note then the script will through the error. So I have changed the reverse loop thats all.

                   

                   

                  var mydoc = app.activeDocument;
                  var rootElement = mydoc.xmlElements.item(0);
                  var linkElementList = rootElement.evaluateXPathExpression("//marginalnote[@type='mn1']");
                  for(var lp=linkElementList.length-1; lp>=0; lp--){
                          var myElement = linkElementList[lp];
                                  var myTextframe = myElement.placeIntoInlineFrame(["21p9","5p"]);
                                 //you have create the object style in you active document the object style name is "MN"; 
                                  myTextframe.appliedObjectStyle= mydoc.objectStyles.item("MN");
                      }
                  alert("Proces Completed");
                  

                   

                   

                  thx

                  csm_phil

                  • 6. Re: How to move marginalnote out in Structure
                    snegig Level 1

                    Thank you soooooo much!!!