applescript font + text size of terminal

is it possible to automatize the font and text size settings of Terminal.app via Applescript?
so that i can have different applescript files that launch terminal windows with different text properties…
tried different variations of something like:

 tell application "Terminal"
	set the size of the text to 14
end tell

but the syntax is obviously wrong.
thanks
p

I don’t think you can do that directly with Terminal, potax - in which case you’re probably stuck with UI scripting:

to set_font to font_size
	tell application "Terminal" to activate
	tell application "System Events" to tell process "Terminal"'s window "Font"
		keystroke "t" using command down
		repeat until exists
			delay 0.1
		end repeat
		tell text field 1 of group 2 of splitter group 1
			set value to font_size as string
			confirm
		end tell
		click button 1
	end tell
end set_font

set_font to 14

Given that you already know the current default, a slightly simpler approach might be to nudge the font size up or down a few notches:

to nudge_font by t to k
	tell application "Terminal" to activate
	tell application "System Events" to repeat t times
		keystroke k using command down
	end repeat
end nudge_font

nudge_font by 2 to "+" (* or, to reduce, use: "-" *)