Script: Adjust tracking (character spacing) of text

LEGEND ,
Oct 15, 2011

Copy link to clipboard

Copied

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:

character tracking original.png

Here the tracking was set to -50:
character tracking m50.png

And here the value was 300:
character tracking p300.png

It works on paragraph text as well.

Enjoy!

Ken

Views

20.0K

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Feb 28, 2013

Copy link to clipboard

Copied

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));

}

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
May 18, 2013

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Jul 19, 2013

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Jul 20, 2013

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Aug 08, 2013

Copy link to clipboard

Copied

Wonderful, works perfectly! Thanks!

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Oct 22, 2013

Copy link to clipboard

Copied

are these MAC or PC instructions.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
LEGEND ,
Oct 22, 2013

Copy link to clipboard

Copied

Read the whole thred, Victor. Post #3 from Bittergal explains how to adapt it for macs.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Oct 22, 2013

Copy link to clipboard

Copied

when I get my degree in computer science I'll understand all this.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Dec 12, 2013

Copy link to clipboard

Copied

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!

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Jun 19, 2014

Copy link to clipboard

Copied

Automation tools is greyed out to me

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Nov 05, 2014

Copy link to clipboard

Copied

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!!!!

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Feb 25, 2015

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Mar 05, 2015

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Jun 15, 2015

Copy link to clipboard

Copied

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!

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Sep 19, 2015

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Beginner ,
Apr 03, 2016

Copy link to clipboard

Copied

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

*/

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Oct 06, 2018

Copy link to clipboard

Copied

Photoshop elements 2019 now includes Character Tracking.

trc.jpg

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Explorer ,
Sep 25, 2020

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more