Skip to main content
October 15, 2011
Question

Script: Adjust tracking (character spacing) of text

  • October 15, 2011
  • 10 replies
  • 23398 views

PSE doesn't show the user all the text formatting capabilities available in PhotoShop, but this script can alter the tracking (character spacing) of the text on a layer.

Here are the steps to use the script:

  1. Open Notepad.
  2. Copy this text and paste it into Notepad:

    /*
    <javascriptresource>
    <name>Character Tracking</name>
    <enableinfo>true</enableinfo>
    <menu>automate</menu>
    <about>Adjust the kerning.</about>
    <category>Typography</category>
    </javascriptresource>
    */

var targettext = app.activeDocument.activeLayer.textItem
targettext.tracking = 30

 

  1. Use "Save As" with the File Type of "All Files" to save it as
    Character tracking.jsx
    in the
    C:\Program Files (x86)\Adobe\Photoshop Elements 10\Presets\Scripts
    directory.
  2. Keep the .JSX file open in Notepad.
  3. Start PSE.  You'll have a new menu item:  File...Automation Tools...Character Tracking.
  4. Create a document in PSE with some text on a text layer.
  5. With a text layer selected, run the Character Tracking script.
  6. To adjust the tracking, simply switch to Notepad and change the numeric value after the equals sign, save the file and re-run it in PSE.  (No need to close and re-open PSE.)

You can use negative values, too -- any number between -1000 and 10000 is OK.

For example, here's the original:

Here the tracking was set to -50:

And here the value was 300:

It works on paragraph text as well.

Enjoy!

Ken

    This topic has been closed for replies.

    10 replies

    Known Participant
    September 25, 2020

    It told me I don't have permission and asked if I want to save it in my rmadi file. What do I do? Who is the administrator?

    Jeff Arola
    Community Expert
    October 7, 2018

    Photoshop elements 2019 now includes Character Tracking.

    jamiewisconsin
    Inspiring
    April 3, 2016

    I'm using Elements 13 on Win10 and it worked great, after I read some of the posted replies to learn how to activate the Automation Tools menu.  Thanks to all.  I used to be on Photoshop CS 4 on Win XP, non of this Elements crap.  It had all kinds of tools for text.

    So I can remember where I got this an dhow to use it, I added this to the bottom of the script code:

    /*

    # I found this script at https://forums.adobe.com/message/3972551

    # April 3 2016 for my Photoshop Elements 13

    # Change the targettext tracking above to useful number for text object i am working on

    # Found 20 to work good with Ariel  Be sure to save this file

    # Can change with PSE open.  Have image document open

    # Select the text layer you want to change

    # Select Move tool, not Text tool

    # Select File menu then Automation Tools then select this file

    # You will see kerning change in the text of the image layer selected

    */

    jtaylor13
    New Participant
    September 20, 2015

    This script worked for me, though I had to select the move tool instead of the text tool to make adjustments. The Character Tracking option is dimmed when the Text tool is selected. I'm using PSE10 on a PC.

    March 5, 2015

    Stepped through the original instructions with the updated script (and Bittergal's Mac suggestions) and still can't seem to access the character tracking options. Should I be saving the script as .jsx or .txt? I can't figure out the former. What am I missing?

    June 15, 2015

    On a Mac, make sure that the extension is a .jsx NOT .txt. If your default settings are like mine, the ".txt" is hidden. Therefore the name will read "Character tracking.jsx" but it is really saved as "Character tracking.jsx.txt" You have to highlight the file and select "get info" (command + i) You can delete the ".txt" extension there and select that you want to use the .jsx extension in the popup. Worked for me; I hope it does for you!

    New Participant
    February 26, 2015

    Works great! Thanks so much for the script and instructions.

    New Participant
    November 5, 2014

    I'm new to the iMac world . . . as of last week.  Anyways, I went to work on a Christmas card for a client and the type is all spaced out!

    I've read through this . . . but, to be perfectly honest I have NO IDEA what it's saying . .. is there anyone who could give me the PSE for DUMMIES version on this issue?
    I'm working with PSE 13

    Thanks!!!!

    New Participant
    December 12, 2013

    In case this is helpful to anyone.... Similar to the Mac user, (although I am using a Windows PC) I too do not seem to have the option to select this new Character Tracking script in the Automation Tools list when I select & "highlight the actual words" in a Text Layer that I wished to "track". If you are having trouble you can tell if you have done this incorrectly if you look on the left PSE side-menu and you see that you are actively using PSE's Horizontal Type Tool.

    The remedy for me was simply to use PSE's Move Tool, then click once to select the text layer field (as if to move it)-  now the Character Tracking script functionality under the Automation Tools menu was available for me to use.  

    Oh and a big THANKS to the programmers of the script!

    New Participant
    June 19, 2014

    Automation tools is greyed out to me

    New Participant
    July 19, 2013

    I've also tried this on my Mac with Elements 11, saving the script from TextEdit, then opening the PSE package in the Applications folder with "Show package contents" and copying it in the folder as mentioned above. However when I run the script from within PSE, I get the following message:

    Error 8: Syntax error.

    Line: 1

    ->  {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390

    Does anybody know what this means and how to fix it?

    New Participant
    July 20, 2013

    By default TextEdit saves files as "rich text" (so it can support things like bold and italic. That causes Elements to get confused. To fix this, open TextEdit, then choose Format -> Make Plain Text. Now copy and paste in the script above and save the file.

    New Participant
    August 8, 2013

    Wonderful, works perfectly! Thanks!

    New Participant
    February 28, 2013

    I've made a slight adjustment to this script. Instead of changing the file every time it will display a prompt where you enter the tracking value.

    /*

    <javascriptresource>

    <name>Character Tracking...</name>

    <enableinfo>true</enableinfo>

    <menu>automate</menu>

    <about>Adjust the kerning.</about>

    <category>Typography</category>

    </javascriptresource>

    */

    if (app.documents.length > 0) {

        var targettext = app.activeDocument.activeLayer.textItem;

        targettext.tracking = parseInt(prompt("Select the tracking value", 0));

    }

    New Participant
    May 18, 2013

    I've tried this on my mac with Elements 11. It works if you run the script through a piece of external scripting software, but not from the menus in Elements.

    As soon as the text is selected, the menu option is greyed out to access the Character Tracking script. Any idea how to change the behaviour or script to be accepted in Elements on the Mac?