1 Reply Latest reply on Jul 6, 2009 6:19 AM by Thomas B. Nielsen

    How to change Anchor Object Options Status of Object Styles?

    R_Thangaraj

      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);
            }