7 Replies Latest reply on Oct 8, 2008 3:40 PM by (SuperMacGuy)

    Finding and replacing Missing Fonts

      Dear All,

      I need to find the missing fonts in the InDesing document and replace them into correct fonts using JavaScript.

      Pl. help.

      Thanks,

      ArcRaj
        • 1. Re: Finding and replacing Missing Fonts
          Peter Kahrel Adobe Community Professional & MVP
          You can find them in the UI, but not in a script. This functionality was sadly lost some time in CS2 and never restored, despite many pleas.

          Peter
          • 2. Re: Finding and replacing Missing Fonts
            Level 1
            Hi Peter,

            It should be working now in 5.03 and above. Seems to work here, anyway, so let me know if it's not!

            Thanks,

            Ole
            • 3. Re: Finding and replacing Missing Fonts
              Peter Kahrel Adobe Community Professional & MVP
              Ole,

              For a moment you had me rejoicing (I hadn't tried this in 5.0.3 yet). But my joy was short-lived, as I still can't get it to work. For instance,

              app.findTextPreferences.appliedFont =
              app.activeDocument.fonts.item ('Swiss 721 BT\tBold');

              still tells me that "The requested font is not available." That font is not installed on my system but is used in the active document.

              Absent fonts seem to confuse ESTK. Getting some properties of this non-installed font leads to different results:

              -- app.activeDocument.fonts.item ('Swiss 721 BT\tBold').index

              gives -1. Don't know what that means, but there's a result and no error.

              -- app.activeDocument.fonts.item ('Swiss 721 BT\tBold').fontFamily

              gives Swiss 721 BT. Result as expected. (It's not the case that to return this property ESTK doesn't bother to check whether the font exists: ...('Olav Kvern\tBold').fontFamily produces an error.)

              -- app.activeDocument.fonts.item ('Swiss 721 BT\tBold').location

              doesn't do much apart from repeating the property name. No error, nothing in the console; just "location" in the staus bar at the bottom of ESTK's app window.

              Am I missing something?

              Peter

              (forgot to mention that this is on Windows XP sp 2)
              • 4. Re: Finding and replacing Missing Fonts
                Level 1
                Hi Peter,

                Oops. I guess it's fixed in...um...a later version.

                Thanks,

                Ole
                • 6. Re: Finding and replacing Missing Fonts
                  Hi Guys,
                  I am having similar headaches. My only workaround at this point is to rely on there being an error. Basically, if I can't set the appliedFont.name as a variable I change it to something else:

                  try {
                  var myFontName = myWord.appliedFont.name;
                  }
                  catch (err){
                  myWord.appliedFont = "Times New Roman";
                  }
                  }
                  }

                  -Nissan
                  }
                  • 7. Re: Finding and replacing Missing Fonts
                    Level 1
                    Dammit. This is another reason this sh** needs bug-fixed! I am SOOO tired of having to deliver [Apple]scripts to my 500 users, just to find that this or that script function is broken. InDesign ought to be on like 5.14 with a slew of fixes.
                    I may file a bug report or something anyways or try to go through our company's support system to raise my comments to the appropriate parties.