Skip to main content
dublove
Legend
July 29, 2026
Question

How to obtain the X coordinate of the left column line and the Y coordinate of the positioning point in the positioning image?

  • July 29, 2026
  • 1 reply
  • 12 views

I have selected an image that is embedded in a text box.
I want to obtain the Y value of the anchor point and the X value of the left column line of the anchor point.

 

    1 reply

    rob day
    Community Expert
    Community Expert
    July 29, 2026

    the Y value of the anchor point and the X value of the left column line

     

    You can get the horizontal offset of the line the image is anchored to, and the line’s baseline:

     

    var d = app.documents[0];
    //a selected anchored frame
    var s = d.selection[0]

    var c = s.parent
    $.writeln(c)//returns the anchored object’s character

    var l = c.lines[0]
    $.writeln(l)//returns the line containing the character

    var hOff = l.horizontalOffset
    $.writeln(hOff)//reurns the line’s horizontal offset—78.99 in the sample file

    var base = l.baseline
    $.writeln(base)//returns the baseline position of the line — 82.7053540039063 in the sample file