Is there a line of applescript I can use to set the font syze of my
text field?
Thank you,
Bernardo Höhl
As far as I know, you can't simply set it as an AppleScript property of
a text field. Please, if anyone knows differently, speak up!
So the question is "Do you REALLY want to do that?" (I can hear Matt's
voice in my head saying "Don't do it! Don't try and make AppleScript
Studio do what it's not built to do! Rethink your ideas!" ;-))
If you do REALLY want to do it, then this, ugly as it is, does it ...
tell text field 1 of window 1
set theDesiredFontSize to 8 -- here is where you set the size you want
set theFont to call method "font" of object it
tell theFont to set theFontName to call method "fontName" of object it
set theFontResized to call method "fontWithName:size:" of class
"NSFont" with parameters {theFontName, theDesiredFontSize}
call method "setFont:" of object it with parameter theFontResized
end tell
I take no responsibility for the use of the above code! ;-)