Skip to main content
Inspiring
May 12, 2026
Question

How to use JavaScript to access position modified by Touch Text Tool?

  • May 12, 2026
  • 3 replies
  • 40 views

Hi there,

I have a vertical textbox, and I need to use a specific font to type text. As you can see below, this particular font creates extra padding on certain characters, which makes the text looks uneven.

I was playing around with different options to see if I can make this gap smaller like so:

After some digging online, I saw suggestions about tweaking kerning or tracking, so I tried both but none of them is doing what I want it to do.

Changing tracking value simply changed padding under the text:

Yes, it looks symmetric now, but the spacing between the numbers and number to + sign is still quite different. Then I tried to use baseline shifting, but that moved the text horizontally..

 

After playing around for a little bit, I found that you can use Touch Type tool to modify the position of individual characters like so:

This achieves what I want to do, so that’s great. The next thing is that I need to be able to replicate this using JavaScript (I have to run this on many instances, so I don’t want to have to do it manually every time).

The issue is that I cannot seem to find where this information is stored (in UI nor JavaScript). Does anyone know what’s this “shift” is called and where I can access this information?

 

Thanks in advance.

 

    3 replies

    Kurt Gold
    Community Expert
    Community Expert
    May 13, 2026

    Modifying characters with the Touch Type tool does not mean that some special kind of shifting is associated with the tool.

     

    Any modification you are applying with the Touch Type tool could also be done (and actually is done) with the Character panel by setting specific values there.

     

    So, you may just look here and check what is usable:

     

    https://ai-scripting.docsforadobe.dev/jsobjref/CharacterAttributes

    TySprice
    Inspiring
    May 13, 2026

    Does the text have to remain as editable text? Or can the text be outlined and then positioned? Positioning outlined text is much simpler. I have done something similar using data merge to swap out text and then doing the alignment by outlining the text and aligning things using JS.

    Inspiring
    May 13, 2026

    Thanks for the response. Ideally, I would like the text to remain editable. Could you elaborate a little bit more about the data merge that you have mentioned? Thanks.

    TySprice
    Inspiring
    May 13, 2026

    For sure! In Illustrator you can create “Variables” within the variable window. Variables can be loaded from a CSV / spreadsheet. Then once you have a set of variables loaded you can use the “Batch” feature of Actions. This allows you to run an action on each variable set. Such as saving out the document with each variable data set loaded. In my case I added a script to the action that outlined text and centered it before saving. You can find more info about variable data here:

    https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/variable-panel-overview.html

     

    Depending on what you are doing Extendscript could offer a better solution than variable data. But if what you are doing is spreadsheet oriented… Variable data can be extremely useful.

    Inspiring
    May 13, 2026

    A thought popped in my head. I thought maybe recording an action would show me what it’s doing so I recoded it. Interestingly, it didn’t show anything as if nothing was executed. I guess this command cannot be recorded?