Skip to main content
October 26, 2009
Answered

Font Select

  • October 26, 2009
  • 1 reply
  • 640 views

Hi, i have this problem when i run a scrit and create a style i want to select a otf font but if is pre-select the script run else if i don't pre-select scritp indesign return error:

     Font Family request is not avaiable

This topic has been closed for replies.
Correct answer Jongware

Can you (at the very least!) show how you select this font? It seems that your command isn't doing anything -- if it only works if you select the font manually but it doesn't if you don't.

Perhaps your initial combination of font and style is not valid? For example, this

app.selection[0].insertionPoints[-1].fontStyle = "65 Bold";

will not work if the selected base font is not Univers. One way to select an entire font plus style is

app.selection[0].insertionPoints[-1].appliedFont = app.fonts.item("Univers LT Std\t65 Bold");

-- note the TAB inbetween the font family and style name.

1 reply

Jongware
Community Expert
JongwareCommunity ExpertCorrect answer
Community Expert
October 26, 2009

Can you (at the very least!) show how you select this font? It seems that your command isn't doing anything -- if it only works if you select the font manually but it doesn't if you don't.

Perhaps your initial combination of font and style is not valid? For example, this

app.selection[0].insertionPoints[-1].fontStyle = "65 Bold";

will not work if the selected base font is not Univers. One way to select an entire font plus style is

app.selection[0].insertionPoints[-1].appliedFont = app.fonts.item("Univers LT Std\t65 Bold");

-- note the TAB inbetween the font family and style name.

October 27, 2009

I create a style:

var style = app.activeDocument.paragraphStyles.add();

Then i select fontFamily

style.appliedFont = "Helvetica Neue LT Std";

But if i don't preselect font indesign return FontFamily request is not avaiable.

Preselect is select font by Select.

It function if i insert a param String but if i insert by a variables it return FontFamily not avaiable:

var font = "Helvetica Neue LT Std";

style.appliedFont = app.fonts.item(font);

I am very stupid....

Thank's.