Get Font Names

Script for Adobe Illustrator, InDesign, or Photoshop

The script reads the application font collection and saves a CSV file with each font name, PostScript name, and name used in script code.

This script came about when a user wanted help changing the font a script used to label images in Photoshop but couldn't figure out the right name to use in the code for the font they wanted. So I wrote this script to help. More about font identification differences between Adobe apps is explained below.

  • Script works in multiple Adobe apps
  • Identifies font names for ExtendScript
  • Adapt open source to customize or create other scripts
Download
Get Font Names
Many scripts are free to download thanks to the support of users. Help me keep developing new scripts by supporting my work. Click the PayPal button to contribute any amount. Thank you.

How to use the script

The script has no interface other than a done alert. Run the script and a CSV file named the application name plus “Fonts” is saved to the user desktop. Edit the script code for a different file name and/or location.

Three columns are output: Font name, PostScript name, and Name to use in script code.

When specifying fonts in ExtendScript, Illustrator and Photoshop want the PostScript name. For example “ArialMT”. InDesign wants the font family, a tab character, then the style. For example “Arial\tRegular”. Having the precise font names avoids trial and error.

Any questions contact the author William at any time.

Source code

(download button below)

/*

Get Font Names
Copyright 2022 William Campbell
All Rights Reserved
https://www.marspremedia.com/contact

Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

*/

(function () {

    var familyNames = [];
    var font;
    var fontNames = [];
    var i;
    var names = [];
    var PSNames = [];
    var styleNames = [];
    if (/Illustrator/.test(app.name)) {
        for (i = 0; i < app.textFonts.length; i++) {
            font = app.textFonts[i];
            names.push([font.family + " " + font.style, font.name, font.name]);
        }
        writeCsv("Illustrator", names);
    } else if (/InDesign/.test(app.name)) {
        familyNames = app.fonts.everyItem().fontFamily;
        styleNames = app.fonts.everyItem().fontStyleName;
        PSNames = app.fonts.everyItem().postscriptName;
        fontNames = app.fonts.everyItem().name;
        for (i = 0; i < fontNames.length; i++) {
            names.push([familyNames[i] + " " + styleNames[i], PSNames[i], fontNames[i].replace("\t", "\\t")]);
        }
        writeCsv("InDesign", names);
    } else if (/Photoshop/.test(app.name)) {
        for (i = 0; i < app.fonts.length; i++) {
            font = app.fonts[i];
            names.push([font.family + " " + font.style, font.postScriptName, font.postScriptName]);
        }
        writeCsv("Photoshop", names);
    }

    function writeCsv(program, names) {
        var file;
        var i;
        file = new File("~/Desktop/" + program + " Fonts.csv");
        file.encoding = "UTF-8";
        file.open("w");
        file.writeln("Font name,PostScript name,Name to use in script code");
        names.sort();
        for (i = 0; i < names.length; i++) {
            file.writeln(names[i].join(",") + "\r");
        }
        file.close();
        alert("Output " + File.decode(file.fullName));
    }

})();
Many scripts are free to download thanks to the support of users. Help me keep developing new scripts by supporting my work. Click the PayPal button to contribute any amount. Thank you.
Download
Get Font Names

For help installing scripts, see How to Install and Use Scripts in Adobe Creative Cloud Applications.

Also available for hire to program custom solutions. Contact William for more information.

IMPORTANT: by downloading any of the scripts on this page you agree that the software is provided without any warranty, express or implied. USE AT YOUR OWN RISK. Always make backups of important data.