Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7997311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:56:30+00:00 2026-06-04T14:56:30+00:00

I’m making an ExtendScript script which goes through all the fonts used in an

  • 0

I’m making an ExtendScript script which goes through all the fonts used in an InDesign document and alerts their name. Here is the code

var usedFonts = app.activeDocument.fonts;
var nbUsedFonts = usedFonts.length;
var i;
for (i = 0; i < nbUsedFonts; ++i) {
  alert(usedFonts.item(i).name);
}

For certain fonts however, the script crashes (Object is invalid) when I access their name property. The only attribute I can access for all fonts without crashing is the isValid attribute, which allowed me to determine that those fonts for which I couldn’t access the name property all had isValid === false, whereas all fonts for which accesing name didn’t cause a problem had isValid === true.

What surprises me is that if I manually place my cursor in the text where one of the problematic fonts is used, its name appears the the normal font chooser or whatever it’s called.

Why can’t I access the name property for some fonts returned to me by app.activeDocument.fonts?

Note:

Here are some of the problematic fonts:

  • Electra LH, Italic
  • Electra LH, Bold Small Caps & Oldstyle Figures
  • Electra LH, Oldstyle Figures
  • Ocean Sans MT, Light OsF

These fonts work without problem:

  • Ocean Sans MT, Light Italic OsF
  • Ocean Sans MT, Semibold SC
  • Ocean Sans MT, Light SC
  • Ocean Sans MT, Light
  • Electra LH, Small Caps & Oldstyle Figures
  • Electra LH, Cursive
  • Electra LH, Bold Oldstyle Figures
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:56:31+00:00Added an answer on June 4, 2026 at 2:56 pm

    The problem may come from fonts missing, you may try to check for these first, and see if it solves your problem:

    var usedFonts = document.fonts;
    for(var i = 0; i < usedFonts.length; i++){
    
        if(usedFonts[i].status != FontStatus.INSTALLED){
            //You can't rely on font.name if the font is missing
            var fontName = usedFonts[i].fontFamily+" "+usedFonts[i].fontStyleName;
        }else{
            var fontName = usedFonts[i].name;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to loop through a bunch of documents I have to put
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.