Skip to main content
Known Participant
April 7, 2012
Answered

Select anchor point of group and anchor it to the insertionpoint

  • April 7, 2012
  • 2 replies
  • 7792 views

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

Correct answer Dave_Saunders

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


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

2 replies

Community Expert
April 8, 2012

@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

SASEKUMARAuthor
Known Participant
April 16, 2012

Yes, you are correct. I need to place the grouped object as anchored in a textframe as absolute position (Placed anchored object should be below to the insertion point).

SASEKUMARAuthor
Known Participant
April 20, 2012

Any suggesstion or sample code is much helpful?

Here is the sample snapshot.

John Hawkinson
Inspiring
April 8, 2012

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.