Skip to main content
dublove
Legend
Mar 30, 2026 10:01 AM UTC
Answered

How can I use a script to retrieve the text box below an image?

My layout has only one column.
However, the text boxes are split into two or three columns.
I have currently selected only the image “imgA”; how can I retrieve the text box below it?
I want to use a script to determine how many columns the text boxes are split into.

Thank you.

 

    rob day
    rob dayCorrect answer
    Community Expert
    Mar 30, 2026 12:20 PM UTC

    You would have to select the image (or image frame), and the target text frame.

    4 replies

    rob day
    Community Expert
    rob dayCommunity ExpertCorrect answer
    Community Expert
    Mar 30, 2026 12:20 PM UTC

    You would have to select the image (or image frame), and the target text frame.

    Translate
    dublove
    dubloveAuthor
    Legend
    Mar 30, 2026 3:41 PM UTC

    ​@rob day 

    Yes, you can select them at the same time and then retrieve the text box and image separately.
    But in practice, it always feels a bit odd. It seems like there’s an extra, unnecessary step.
    Another approach is to assign the value to the paragraph style name, which seems to work as well.

    Translate
    Community Expert
    Mar 30, 2026 11:20 AM UTC

    You image don’t seem to be anchored into the textframe below it so there is no direct relation between them. Now the only way I can think of is a logic to define if the coordinates of both these boxes overlap

    Translate
    -Manan
    dublove
    dubloveAuthor
    Legend
    Mar 30, 2026 4:06 PM UTC

    ​@Manan Joshi 

    Is it possible to determine this based on the object in the background layer of the image?

    Translate