Getting Anchor insertion point
Hi experts,
Can someone tell me where I go wrong with below script ? Purpose is to release an inline anchored object, do something with the object, and put it back where it was originally.
var myAnchor = app.selection[0];
var myIP= myAnchor.insertionPoints[0] ; // should be the point where the current object is anchored on the doc
var myAnchorPosition = myAnchor.anchoredObjectSettings.anchoredPosition;
with (myAnchor)
{
// make custom so it can be released
anchoredObjectSettings.anchoredPosition = AnchorPosition.anchored;
anchoredObjectSettings.releaseAnchoredObject();
// ============================
// do some stuff with the object ...
// ============================
anchoredObjectSettings.insertAnchoredObject(myIP, myAnchorPosition);
}
I'm using CS6, and found similar scripts as above here but it fails to work, I'm getting error 'Object does noet support the property or method insertionPoints' ... So my question is : How to get a reliable way to store an anchors current insertion point, so we can place a reworked object back later.
Thanks,
K.
