Copy link to clipboard
Copied
I'm trying to get the position of point text from left anchor if left aligned, middle if center aligned and right if right aligned. is this even possible?
here are the keys of object I am trying to get at, if that helps
keys:
story : [Story]
contents : export me
textRange : [TextRange]
textSelection : [TextRange]
rowCount : 1
columnCount : 1
rowGutter : 0
columnGutter : 0
flowLinksHorizontally : true
spacing : 0
opticalAlignment : false
kind : TextType.POINTTEXT
contentVariable : undefined
orientation : TextOrientation.HORIZONTAL
this is what I am using to get at it:
app.activeDocument.textFrames[2].anchor[0]
am i confusing anchor point with baseline position?
Copy link to clipboard
Copied
This looks right to me what makes you question it? Anchor is only valid for point text… If you have no baseline shift then I would expect it to be the same as baseline of the first para
Copy link to clipboard
Copied
I am not sure what was going on, I found another post where you mentioned outlining text. so did something like:
var temporaryText = currentTextItem.duplicate().createOutline(),
// temporaryText is defined earlier
left = Math.round(temporaryText.visibleBounds[0]),
top = Math.abs(Math.round(temporaryText.visibleBounds[1])),
right = Math.round(temporaryText.visibleBounds[2]),
bottom = Math.abs(Math.round(temporaryText.visibleBounds[3]));
temporaryText.remove();
that way I can get all the bounding boxes exactly without wierd vector problems. Note I add the round and absolute math function so that I can get positive/even numbers, just easier for my brain to processes.
seems to work now though. very weird.
Copy link to clipboard
Copied
That I think is the only way to get bounds of type as here…

Anchor is the actual path point… As here for range left…

Get ready! An upgraded Adobe Community experience is coming in January.
Learn more