Skip navigation
Currently Being Moderated

How to move marginalnote out in Structure

Jul 22, 2012 5:23 AM

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!

 
Replies
  • Currently Being Moderated
    Jul 22, 2012 11:39 AM   in reply to snegig

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 23, 2012 2:45 AM   in reply to snegig

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

     

    Requirement not clear...

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 23, 2012 3:39 AM   in reply to snegig

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points