Skip navigation
Currently Being Moderated

Select anchor point of group and anchor it to the insertionpoint

Apr 7, 2012 3:38 AM

Hi all

How to select group's anchor point and anchor it to document's insertion point in indesign cs5.5  using javascript or vb.net

 
Replies
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Apr 7, 2012 9:10 PM   in reply to SASEKUMAR

    I don't understand your question.

    Documents don't have insertion points.

     

    In the scripting DOM you don't real with the anchor points of the group, you just reposition the group entire.    

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 8, 2012 2:41 AM   in reply to SASEKUMAR

    @Sasekumar – would you like to add grouped objects to an insertion point in a text frame?
    Result will be an inline or anchored group object.

     

    Do you want to control the absolute or relative position of the anchored group object?

     

    Is that your intent?

     

    Uwe

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2012 10:45 AM   in reply to SASEKUMAR

    You can't add a group as an anchored object as you would with, say, a rectangle—with insertionPoint.rectangles.add(); there is no insertionPoint.groups.add(). If you're working with InDesign desktop, you can select the group, cut or copy it, select the insertionPoint, and paste. Then do group.anchoredObjectSettings.properties = {anchoredPosition: AnchorPosition.ANCHORED, pinPosition: false}, then group.move() to your absolute coordinates.

     

    If you're working with InDesign Server and don't have select, copy or paste, you'll have to do some acrobatics with snippets or libraries to get your group anchored. It's been covered here somewhere before...

     

    Jeff

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2012 11:38 AM   in reply to absqua

    You need to get a reference to your group -- let's call it myGroup -- and another to the insertionPoint where you want it anchored -- let's call it myIP. Given those, you can achieve your objective (in CS5 or later) by:

     

    myGroup.anchoredObjectSettings.insertAnchoredObject(myIP);

     

    You can specify a second parameter if you wish that specifies the anchor position:

     

    myGroup.anchoredObjectSettings.insertAnchoredObject(myIP, AnchorPosition.anchored);

     

    That should get you started.

     

    Dave

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2012 11:44 AM   in reply to Dave Saunders

    Whaaa? That's great. I had no idea. I think it's in CS5.5 and above though; I don't see it CS5.

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2012 11:49 AM   in reply to absqua

    Yes you're right. It's the scripting equivalent of grabbing the box at top right of a frame and dragging it to an insertionPoint, and indeed, that came in with CS5.5.

     

    Dave

     
    |
    Mark as:
  • Currently Being Moderated
    May 3, 2012 1:46 AM   in reply to SASEKUMAR

    So please mark the question as "Answered".

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 13, 2012 11:38 PM   in reply to SASEKUMAR

    Hi,

              Am getting error as "myGroup.anchoredObjectSettings.insertAnchoredObject is not a function"...pls advice.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 13, 2012 11:39 PM   in reply to Dave Saunders

    Hi,

    Am getting error as "myGroup.anchoredObjectSettings.insertAnchoredObject is not a function"...pls advice.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 14, 2012 7:52 AM   in reply to Cenchen

    What version of InDesign are you using?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 15, 2012 9:50 PM   in reply to absqua

    CS5.5

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 16, 2012 6:27 AM   in reply to Cenchen

    Hi Kannan,

     

    Please check again.  You are using that method available CS5.5 onwards,  the older InDesign version doesn't have that method. check again what version of InDesign references are you added in Vb.net project. ?

     

    Regards,

    Nagaraj

     
    |
    Mark as:
  • Currently Being Moderated

    Hi Nagaraj,

     

                        Am using InDesign CS5.5 and this error getting from javascript not vb.net....

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2012 3:42 AM   in reply to Cenchen

    try this below code,  make grouped object on the document first page then place the insertionPoint at any textframe. and run this below code.

     

    var myIP = app.selection[0].insertionPoints[0];

    app.activeDocument.pages.firstItem().groups[0].anchoredObjectSettings. insertAnchoredObject(myIP);

     

    I hope this will helps to you.

     
    |
    Mark as:
  • Currently Being Moderated

    err.jpg

    The same error thrown....

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2012 4:40 AM   in reply to Cenchen

    May i Know the InDesign CS5.5 version number. like 7.5.3 is the latest updates. ?

     
    |
    Mark as:
  • Currently Being Moderated

    InDesign CS5.5 ver.number 7.5...

    Version 7.5 won't work???

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2012 5:03 AM   in reply to Cenchen

    Update the patches and try again.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2012 11:53 AM   in reply to Cenchen

    @EyenanC – I just tested with InDesign CS5.5 7.5.3. The script is running without error.


    I used the code of கற்பனை (Imagine), What you need is a text frame and a group on page 1 of your document. Select the text frame and run the script: the group will be anchored to the first insertion point of your selected text frame.

     

    @Dave Saunders – thank you so much for pointing us to that capability of InDesign CS5.5 scripting DOM!

     

    Uwe

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

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