Skip to main content
Participant
September 2, 2008
Question

Finding and replacing Missing Fonts

  • September 2, 2008
  • 7 replies
  • 1142 views
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
This topic has been closed for replies.

7 replies

Known Participant
October 8, 2008
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.
Participating Frequently
September 25, 2008
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
}
Peter Kahrel
Community Expert
Community Expert
September 4, 2008
Aha!
Known Participant
September 3, 2008
Hi Peter,

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

Thanks,

Ole
Peter Kahrel
Community Expert
Community Expert
September 3, 2008
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)
Known Participant
September 2, 2008
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
Peter Kahrel
Community Expert
Community Expert
September 2, 2008
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