2 Replies Latest reply on Oct 27, 2009 2:22 AM by S.Biancardo

    Font Select

    S.Biancardo Level 1

      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

        • 1. Re: Font Select
          [Jongware] Most Valuable Participant

          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.

          • 2. Re: Font Select
            S.Biancardo Level 1

            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....