What fonts are used in an .indd file?

Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / What fonts are used in an .indd file?

Viewing 1 reply thread
  • Author
    Posts
    • #1230115

      Hi all,
      Greetings.

      I like to have a list of the names of the fonts that are used in any .indd file. The name of the fonts are to be saved as a separate .indd file. How can I do this using the javascript scripts?

      Thanks in advance.

    • #14323029
      Robert Ploch
      Member

      Hi,
      try this simple piece fo code. Id saves a text file filled with complete list od used fonts on the same level as original INDD file.
      In my opinion it is the simplest and most flexible way to have a font list. You can use it with INDD or/and e.g. Excell.

      Best regards Robert

      if ( !app.documents.length ) { alert ( ‘Open document, please !’ ); exit(); }

      var doc = app.activeDocument, dp = doc.filePath.fsName, dn = doc.name.slice(0,-5), fonts = doc.fonts.everyItem().name;

      var raport = fonts.join( ‘\r’ );

      saveTextFile ( raport );

      function saveTextFile ( text ) {
      var tf = new File ( dp + ‘/’ + dn + ‘_FontList.txt’ );
      tf.open ( ‘w’ ); tf.encoding = ‘utf-8’; tf.write( text ); tf.close();
      }

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
>
Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo