Skip to main content
Inspiring
May 7, 2026
Question

How-to automatically update location of an object when another object changes

  • May 7, 2026
  • 7 replies
  • 102 views

Hi there,

 

I am trying to see if there is a way to “link” the position for two objects. For example, let’s say I have one text that I can edit. I have another text which I want to place it certain pixel away from the previous text and I want to maintain that distance when the previous text is edited automatically.

Let’s say i have one text box at location (10,10) with length of 5. The text should always be 15px to the right, and 2 pixels up, so in this case, it should be at location (10+5+15, 10 - 2) = (30, 8).

Now, if the first text changes and the length increased to 10, and vertically moved down 13px, then the other textbox should automatically be readjusted to (10+10+15, 10 + 13 - 2) = (35, 21).

I know I can manually update them, but I might have a lot of it and manually updating them could be tedious or prone to error or might have something more complex than just two texts.

My question is that is there a way to “link” these objects’ positions such that if one changes, the other will automatically change too? I tried to search online but didn’t see anything exactly addresses this issue. Let me know if more complicated example would help explaining the issue.

Thanks in advance.

    7 replies

    Kurt Gold
    Community Expert
    Community Expert
    May 13, 2026

    Here is another approach with two separate text objects:

     

    Flexible equations 1

     

    You can increase/decrease the number of digits for enumerator and denominator. The equation will be elastic.

    CarlosCanto
    Community Expert
    Community Expert
    May 14, 2026

    what kind of sorcery is this?!

    Kurt Gold
    Community Expert
    Community Expert
    May 14, 2026

    The first sample (Flexible enumerator) combines underlined type with Warichu to create the fraction.

     

    The second sample (Flexible equations) uses an additional rectangle to create the fraction line, and text wrapping to make the equation elastic.

    Kurt Gold
    Community Expert
    Community Expert
    May 13, 2026

    The sample Illustrator file below is certainly no eye candy, but it comes with a flexible enumerator for fractions and it may serve as an idea starter.

     

    Flexible enumerator 1

     

    To get flexible denominators would be a bit more tricky.

    Inspiring
    May 13, 2026

    I apologize for not having included examples in my original posts to highlight issue.

    Here is an example:

    Say initially have an equation (E.X / 4) = 13c, which can be represented like above. Now, let’s say I change part of the fraction such that the width of the fraction gets longer:

    Depending on the alignment, it could result in something like this:

    However, as you can imagine, this is not the idea result that I want. Ideally, it would be something like:

     

    Where the value will continue to follow the previous text with the same amount of padding. Hope that makes sense.

    Jacob Bugge
    Community Expert
    Community Expert
    May 13, 2026

    JollyPanda,

     

    Apologizing in advance for silliness, but how about

     

    1 ) Initially turning the fraction into one object if not already,

    2 ) Initially turning the = 23C into another one object if not already which is/can be made so the the equation mark is flush with the line so no 2 pixels up,

    After each editing of the fraction

    3 ) Applying Distribute Spacing corresponding to the 15px.

    Maybe done as script or action?

     

    Even sillier, 2 ) made me hear the beginning of an old song,

    Murder murder polis, three stairs up

     

    CarlosCanto
    Community Expert
    Community Expert
    May 12, 2026

    I’m probably oversimplifying but wouldn’t a baseline shift work with a single text box instead of two of them?

     

    Inspiring
    May 13, 2026

    Thank you for the suggestion and apologize for not including more detailed example. I am not sure if this method would work since the string in my case is slightly more complicated. 

    CarlosCanto
    Community Expert
    Community Expert
    May 9, 2026

    yes, post a more complicated scenario and please post screenshots or share a file showing both the easy and the complex scenarios.

     

    it could be scripted but it won’t be automatic, you would do your changes, then you would run the script to reposition one or multiple pairs of text items

    Inspiring
    May 13, 2026

    Thanks for the response. My bad and I should have included the screenshot to better explain my problem. I have added a new reply with an example. Thanks.

    Kurt Gold
    Community Expert
    Community Expert
    May 8, 2026

    It would indeed be helpful to provide a sample Illustrator file with instructions about the desired behaviour in more complicated cases.

    Inspiring
    May 13, 2026

    Thanks for the response. As I mentioned in the previous reply, my fault for not including more descriptive example. I have added one. Thank you.

    Jacob Bugge
    Community Expert
    Community Expert
    May 8, 2026

    JollyPanda,

     

    I wonder whether there is some cunning scripting solution.

     

    Any scripter can tell?

     

    Inspiring
    May 13, 2026

    Funny you mention this. I am actually working on one right now. However, even with scripts, it’s not automatic since you will have to remember to run the script against whenever the object changes, but it’s definitely better than do everything manually each time.