How to release Anchored objects in an .indd file

I need to programaticaly release anchored objects in a opened indd file so that images's coordinates could get. does any one have an idea about how to do that.
Thanks

I need to programaticaly release anchored objects in a opened indd file so that images's coordinates could get. does any one have an idea about how to do that.
Thanks

Similar Messages

  • [JS CS3] Releasing Anchored Objects

    Hello,
    The following script places a libray item as an anchored object...
    var myDoc = app.documents[0];
    var myFrame = app.documents[0].textFrames.item("myTarget");
    var myInsertPoint=myFrame.parentStory.paragraphs.item(0).insertionPoints.item(0)
    var myLibraryItem=app.libraries[0].assets[0]; myFrame=myLibraryItem.placeAsset(myInsertPoint);
    with(myFrame[0].anchoredObjectSettings){
    anchoredPosition = AnchorPosition.anchored;
    anchorPoint = AnchorPoint.topLeftAnchor;
    horizontalReferencePoint = AnchoredRelativeTo.anchorLocation;
    horizontalAlignment = HorizontalAlignment.leftAlign;
    anchorXoffset = 0;
    anchorYoffset = 0;
    How do I now release my anchored library item and then send it behind the text in the text frame "myTarget" ?
    Thanks
    Simon Kemp

    Thanks Harbs, this has made things simpler.
    I have heard your name mentioned several times today in the InDesign Secrets podcast (and Dave's too).
    I am almost there with the script (my scripting is clumsy but I can usually get things to work mainly with help from this forum.
    My last problem is that I am re-applying geometric bounds to the released anchored object as it is still being referenced as myAnchoredFrame.
    Is it possible to release ALL the anchored objects in one go? Or how do I dump the reference to myAnchoredFrame once it has been released?
    var myTextFrame = app.documents[0].textFrames.item("myTarget");
    var myParagraphs = myTextFrame.paragraphs
    for (var i = 0; i <= myParagraphs.length-1; i++) {
    var nLines = myParagraphs.item(i).lines.length;
    var myAnchoredFrame = myTextFrame.paragraphs.item(i).insertionPoints.item(0).textFrames.add();
    var myHeight = nLines*myParagraphs[i].leading*.353
    myAnchoredFrame.geometricBounds = [0, 0, myHeight, (myTextFrame.geometricBounds[3]-myTextFrame.geometricBounds[1])];
    myAnchoredFrame.fillColor = "Gradient";
    myAnchoredFrame.gradientFillAngle = 90;
    myTextFrame.texts.item(0).recompose;
    with(myAnchoredFrame.anchoredObjectSettings){
    anchoredPosition = AnchorPosition.anchored;
    anchorPoint = AnchorPoint.topLeftAnchor;
    horizontalReferencePoint = AnchoredRelativeTo.anchorLocation;
    horizontalAlignment = HorizontalAlignment.leftAlign;
    verticalReferencePoint = VerticallyRelativeTo.capheight;
    verticalAlignment = VerticalAlignment.topAlign;
    anchorXoffset = 0;
    anchorYoffset = -1;
    pinPosition = false
    myAnchoredFrame.anchoredObjectSettings.releaseAnchoredObject ()
    myAnchoredFrame.sendToBack();
    Thanks again
    Simon Kemp

  • How to create Anchored Object (CS2)

    Hi,
    Indesign CS2(PC version)
    Javascript
    Any one help me, How to create Anchored object within TextFrame and inside anchor object i want to paste one image.
    by
    Sudar

    Hi Hemi,
    Sure--tell the insertion point to create the object. For example, to add a text frame:
    //Given a reference to an insertion point "myInsertionPoint"...
    var myFrame = myInsertionPoint.textFrames.add();
    Now you have a text frame anchored/inline in the story. Next, recompose the story containing the frame:
    myInsertionPoint.parentStory.recompose();
    ...and resize the frame.
    //Given a frame width and height "myFrameWidth" and "myFrameHeight"...
    var myX1 = myFrame.geometricBounds[1];
    var myY1 = myFrame.geometricBounds[0];
    var myX2 = myX1 + myFrameWidth;
    var myY2 = myY1 + myFrameHeight;
    myFrame.geometricBounds = [myY1, myX1, myY2, myX2];
    At this point, you can adjust the frame's anchored object settings (your settings will probably vary, but this should give you the idea).
    var myAnchoredProperties = myFrame.anchoredObjectSettings;
    myAnchoredProperties.anchorPoint = AnchorPoint.topLeftAnchor;
    myAnchoredProperties.anchoredPosition = AnchorPosition.anchored;
    //NOTE inconsistent "o" in "offset".
    myAnchoredProperties.anchorXoffset = 0;
    myAnchoredProperties.anchorYoffset = -13;
    Hope this helps!
    Thanks,
    Ole

  • How to release a object that is set to obselete?

    Hi All,
    In my development system i need to develop a workflow using BUS1007/BUS1008.
    But it is set to obselete.
    Can anyone tell me How to release a object that is set to obselete?
    Thanks and regards,
    Raj

    Hello,
    As per the documentation on Business object builder on help.sap.com,
    Obsolete object types/object type components show that the functions are being discontinued and replaced with other functions that are incompatible.
    Object types or object type components being discontinued and designated by SAP as obsolete are still supported in the change release and the next release. The old functions and the new functions are available in parallel for this period.
    Incompatible changes are included by SAP in a central release note.
    So, it is better that you look out for other business objects. I am not sure, but I think you can use the BO KNA1 in place of 'BUS1007' and LFA1 for BUS1008 as the key fields are same for both the business objects.
    Hope this will help.
    Regards,
    Samson

  • Releasing Anchored objects

    I saw a couple of earlier posts with code for releasing an anchored object ( http://forums.adobe.com/click.jspa?searchID=2331267&objectType=2&objectID=1109584 and http://forums.adobe.com/click.jspa?searchID=2331267&objectType=2&objectID=2062943 ) but I'm not sure how to make this work for my current situation, so would one of you folks give me a hand, please?
    I'm building a directory where business names are in one paragraph style that is a numbered list, but each of these paragraphs has anchored at the the beginning a frame containing proprietor names and phone numbers in other separate paragraph styles. I need to build an alphabetical index of stores and proprietors with the index number from the list. This actually isn't too hard to organize because I can set the numbered list style to start on next page, thereby making the list number and page number the same, but I need to release all the anchored objects so they don't get pulled in as part of the store name. I figure this should be pretty simple, so how about it? CS4, if it matters.
    Peter

    I didn't check the posts you mentioned, but I remembered there was a catch (an anchored object is identified only by having 'anchoredObjectSettings'). The extra try..catch surrounding the 'release' ought to shield you from oddities, as in "you can't release an anchored graphic".
    Other than that ... perhaps it's easier if you can select a text frame to release everything within? Or at once everything in the entire document?

  • How to change Anchor Object Options Status of Object Styles?

    hi to all,
    here i'm creating Object Style and applying some properties, when i create a Object Style, and the anchor Object options not become true status instead it being in false status how do i change status of anchor Object options of object styles
    pls help me
    here the i tried code,....
      myAnchorFrame.contents =selItem;
         try{
         var rightObjStyle = app.activeDocument.objectStyles.add({name: "RightAlignment"});
         with(rightObjStyle.anchoredObjectSettings)
          spineRelative = false;
          anchoredPosition=AnchorPosition.anchored;
          anchorPoint = AnchorPoint.LEFT_CENTER_ANCHOR;
          horizontalAlignment = HorizontalAlignment.RIGHT_ALIGN;
          horizontalReferencePoint = AnchoredRelativeTo.COLUMN_EDGE;     
          anchorXoffset = spaceVal;
          verticalReferencePoint = VerticallyRelativeTo.lineBaseline;
         }}catch(e){
           myCharacterStyle = app.activeDocument.objectStyles.item("RightAlignment");
           myCharacterStyle.anchoredObjectSettings.anchorXoffset= spaceVal;
          try{
         var leftObjStyle = app.activeDocument.objectStyles.add({name: "LeftAlignment"});
         with(leftObjStyle.anchoredObjectSettings)
          spineRelative = false;
          anchoredPosition=AnchorPosition.anchored;
          anchorPoint = AnchorPoint.RIGHT_CENTER_ANCHOR;
          horizontalAlignment = HorizontalAlignment.LEFT_ALIGN;
          horizontalReferencePoint = AnchoredRelativeTo.COLUMN_EDGE;     
          anchorXoffset = spaceVal;
          verticalReferencePoint = VerticallyRelativeTo.lineBaseline;
         }}catch(e){
           myCharacterStyle = myDocument.objectStyles.item("LeftAlignment");
           myCharacterStyle.anchoredObjectSettings.anchorXoffset= spaceVal;
          try{
         var L_RObjStyle = app.activeDocument.objectStyles.add({name: "L/RAlignment"});
         with(L_RObjStyle .anchoredObjectSettings)
          spineRelative =true;
          anchoredPosition=AnchorPosition.anchored;
          anchorPoint = AnchorPoint.LEFT_CENTER_ANCHOR;
          horizontalAlignment = HorizontalAlignment.LEFT_ALIGN;
          horizontalReferencePoint = AnchoredRelativeTo.COLUMN_EDGE;     
          anchorXoffset = spaceVal;
          verticalReferencePoint = VerticallyRelativeTo.lineBaseline;
         }}catch(e){
           myCharacterStyle = myDocument.objectStyles.item("L/RAlignment");
           myCharacterStyle.anchoredObjectSettings.anchorXoffset= spaceVal;
          if(align =="Left")
           myAnchorFrame.applyObjectStyle(app.documents[0].objectStyles.item("LeftAlignment"), true);
          else if (align =="Right")
           myAnchorFrame.applyObjectStyle(app.documents[0].objectStyles.item("RightAlignment"), true);
          else if(align =="Left/Right")
           myAnchorFrame.applyObjectStyle(app.documents[0].objectStyles.item("L/RAlignment"), true);

    Is it the:
       enableAnchoredObjectOptions = true;
    As shown here: http://forums.adobe.com/thread/454988?tstart=30

  • Release Anchored Objects

    Hi,
    Does anyone knows about a scrip able to release all the anchored objects in a InDesign 5.5 document?
    Thank you in advance
    Maria

    Hi Maria,
    Please use the below JS code, But the code is your requirement has been solved, i feel this way is big round circle. So any one make short your requirement after my script to edit or modify.
    var myDoc = app.activeDocument;
    var myPGItem = myDoc.allPageItems;
    for(j=0; j<myPGItem.length; j++){
        var myAncObj = myPGItem[j];
        if(myAncObj.parent.constructor.name=="Character"){
            if(myAncObj.constructor.name =="TextFrame" || myAncObj.constructor.name =="Rectangle" || myAncObj.constructor.name =="Group"){
                myAncObj.anchoredObjectSettings.releaseAnchoredObject();
    thx
    csm_phil

  • How to get Anchor object pointer

    Hi All,
    I have a text frame and and i have an anchor object attached to it. Now i just select the text frame and get the UID of the text frame. Now i would like to get the Anchor object ineterface pointer with attached to the Text Frame.How to get it?
    Thanks
    Sakthivel.P

    Hi Sergiy,
    I tried, but i am getting the ownedItem Interface pointer as null.
    This is what i tried
        ISelectionManager* iSelMgr = nil;
        iSelMgr = Utils<ISelectionUtils>()->GetActiveSelection();
        if(iSelMgr == nil) return kFalse;
        InterfacePtr<ISupUnTagEleUISuite>selItemSuite(iSelMgr,UseDefaultIID());
        if(selItemSuite == nil) return kFalse;
        UIDRef itemRef;
        if(selItemSuite->GetSelectedUID(itemRef)==kFalse) return kFalse;
        InterfacePtr<IHierarchy> itemHier(itemRef,UseDefaultIID());
        if(itemHier == nil) return kFalse;
        InterfacePtr<IOwnedItem> ownedItem(itemRef.GetDataBase(),itemHier->GetParentUID(),UseDefaultIID());
        if(ownedItem) return kFalse;
        if (Utils<IFrameUtils>()->IsPageItemAnchoredObject(ownedItem->GetFrameRef()) != kFalse)
            return kTrue;
    Thanks
    Sakthi

  • How to read XMP metadata of an indd file using Actionscript

    Hi All,
    I am trying to read XMP metadata of an indd file using CS Extension Builder in Flash Builder 4.5.
    The documentation has many class like XMPmeta, XMPStruct, etc.
    I have got the currently opened document in InDesign as follows:
    var myDoc:Document = InDesign.app.activeDocument();
    And a new XMPmeta object is created as follows:
    var myXMP:XMPMeta = new XMPMeta();
    How to initialize document's xmp metadata in the XMPMeta object? Or is there any other way to get the XMP metadata of currently opened document in InDesign?

    I have found that the XMP data of an InDesign document can be retrieved in actionscript as follows:
    InDesign.app.activeDocument.metadataPreferences
    This returns the MetadataPreference object.
    But I am not able to iterate each namespace in the xmp. There isn't any XMPFile class which allows me to serialize the object to xml file so that I can iterate all elements in the XMP.
    I could not relate class like XMPMeta, XMPProp, etc. with the MetaDataPreference class. So, how to obtain the entire xmp packet from the MetadataPreference object?
    Can anyone shed light on this?

  • How to create an object of a binary file?

    Does anyone know how I may create a serializable object of a binary file?
    Thanks.

    Sorry for the late reply.
    No, I'm not trying to deserialise a serialised object. My intent is to create a serialisable object from a binary file and then store this object in a JMS Queue.
    One option is to create a byte array of the binary file. Wondering if there are other options available.

  • How to close the object after generation Excel file

    I have generated excel file. I save that file using "Save" button on dialog-box. After i go to menu navigation at that time i got javascript error.
    please give me the solution how to close objects after generating excel file.

    Hi,
    Pls don't forget to reward points and close the question if you find the answers useful.
    Eddy

  • How to get all TextFrame from ImportedPage INDD Files?

    Hi everyone!
    Do you know the javascript scripts to get all textFrames in importedPage (.indd file)? Is it posible to do that or have some trick to do it?

    Use
    JDR_UTILS.LISTDOCUMENTS
    Use this API to list of all OA Framework the documents in a path/module. This script is very handy, as it provides a list of all the desired documents/extensions/personalizations in one go.
    DECLARE
    BEGIN
    jdr_utils.listdocuments('/oracle/apps/po/setup', TRUE);
    END;
    Thanks
    --Anil
    oracleanil.blogspot.com

  • How to save an "Object" in a selected file ?

    Hi,
    I would like to save an object with for example a PlanarImage object type in a selected file from JFileChooser
    Do you know how to do it ?
    I tried this but it didn't work :
    File fChoosen = chooser.getSelectedFile();
    ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(fChoosen));
    os.flush();
    os.writeObject(planImage); //write the planarImage
    os.close();
    Thanks a lot !

    Is "PlanarImage" one of your classes? If so, it has to implement the Serializable interface if you want to write it like that.

  • How to use same object in another vi file.

    Hi i am new to OOP in labview.
    How to use (ACCESS) same Object in multiple VI fiels in labview.
    in c# if we use same name space , then we can acces the object .
    i dont know how to use it in labview.
    and also i need to know , how to use oop in large applications

    Well LVOOP tries to be this...
    And the Actor Framework tries to be this... Using some of LabVIEW's object oriented components.
    You can have LVOOP without Actor Framework, but you can't have the Actor Framework without LVOOP.  You can however have other actor based designs without LVOOP but honestly few go this route because classes help force the developer to work inside the constructs of the design.
    Also quit yelling so much.  And before you try taking on LabVIEW's object oriented designs (and Actor for crying out loud) I'd suggest taking some beginner training which can be found at the bottom of this page.
    https://decibel.ni.com/content/docs/DOC-40451

  • How to read multiple objects stored in a file.

    Hi,
    there is a file on which multiple object have been written.
    Now while reading it back, is it necessary to read the objects in the same sequence in which they were written or i can randomly read any object?
    thanx
    deepak saini

    I suppose you could use random file access, but you would need to keep track of where you put the objects.

Maybe you are looking for