change rtf text field back to plain text?

Hi all…

For a while I’ve been using this nice method successfully to read an RTF file into a text field:

tell main bundle to set thePath to path for resource theinfofile extension "rtf"
call method "readRTFDFromFile:" of object (text view "infotext" of scroll view "infoscroll" of view of tab view item "help" of tab view "maintabs" of window "prefs") with parameter (thePath)

However, I can’t figure out how to re-set the contents of that same text field to a text string without keeping the RTF formatting. The problem is the RTF usually starts with a big bold font. If I could just change the whole thing to a smaller non-bold font that would be ok too. But plain text would be better.

This does not do a thing (with setting the rich text to false deliberately before & after setting the content of the text view):


set rich text of (text view "infotext" of scroll view "infoscroll" of view of tab view item "help" of tab view "maintabs" of window "prefs") to false
set content of text view "infotext" of scroll view "infoscroll" of view of tab view item "help" of tab view "maintabs" of window "prefs" to "new string"
set rich text of (text view "infotext" of scroll view "infoscroll" of view of tab view item "help" of tab view "maintabs" of window "prefs") to false

Thanks

OK, this doesn’t make it into plain text, but this solution suits my purposes at least so that the text is not huge, bold, and centered:


call method "setFont:" of (text view "infotext" of scroll view "infoscroll" of view of tab view item "help" of tab view "maintabs" of window "prefs") with parameter (call method "fontWithName:size:" of class "NSFont" with parameters {"Geneva", 10})
call method "setAlignment:" of (text view "infotext" of scroll view "infoscroll" of view of tab view item "help" of tab view "maintabs" of window "prefs") with parameter "alignLeft:"