Setting the font in a text view

The Applescript Studio documentation says that if you want to set the font for a text view, simply go into interface builder, select the view, then pull up the font menu and choose your preferred font.

Unfortunately, when I do that (making sure I don’t have the scroll view selected, of course), it never sticks. Rather, it works in Interface Builder, but in my application when I type in the view, I get the system default font. I can then go to the font menu and change to a different font, but I want the user to start out in my preferred font (courier - monospaced).

Has anyone had success setting the default font of a text view?

I’ve got a couple of questions about what you mean.

Do you want the new font to be default for any interface builder app, or do you just want the specific font on this document?

Also, do you mean text field or text view, because I’m much more knowledgable about text fields.

I suggest you try something like this:


tell window "nameOfWindow"
   set font of text field "nameOfTextField" to "nameOfFont"
end tell

I’m not positive that will work, but it seems like your best bet.

I’ll give it a try.

As to your questions, I want it to be the default font for the text view in the particular application I’m building.

Thanks for your help!

-Joe

The set font command yields a “key” error. The documentation says the font setting is not available as of Applescript Studio 1.4.

I guess I’ll keep trying things and see what I come up with.

Thanks agian,

-Joe