Question
Detect missing font with script
You can find the name of a font with
app.fonts.getByName(myLayer.textItem.font).name;However, if the font is missing it'll throw an error. So we use try/catch
displayDialogs = DialogModes.NO; // OFF
var myLayer = app.activeDocument.activeLayer;
var msg = "";
try
{
var myFont = app.fonts.getByName(myLayer.textItem.font).name;
msg += "my font name: " + myFont;
}
catch(eek)
{
var myFont = undefined;
msg += "my font name: " + myFont;
}
alert(msg);
Is there another try/catch method I can use to determine if they are either:
(A) typekit/Adobe fonts
or
(B) fonts that have just been uninstalled?
Cheers
