<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><BR></DIV><DIV>On 28-mars-07, at 17:39, Henrik Nyh wrote:</DIV><DIV><BR></DIV><BLOCKQUOTE type="cite"><DIV>Brandon Farr wrote:</DIV><BLOCKQUOTE type="cite"><DIV>Does anyone know if it is possible to change TextMate's display font via Applescript. I'd like to do this so that I can work in one font size, and print in another.</DIV></BLOCKQUOTE><DIV><BR></DIV><DIV>Should be possible with GUI scripting: <A href="http://www.apple.com/applescript/uiscripting/">http://www.apple.com/applescript/uiscripting/</A></DIV><DIV><BR></DIV><DIV>So you'd either have AppleScript navigate the menus (View > Font > Bigger/Smaller) or fake keypresses ⌘+, ⌘-.</DIV><DIV><BR></DIV><DIV>That said, there might be a better solution than AppleScript/GUI scripting, but I'm not aware of it.</DIV></BLOCKQUOTE><BR><DIV><BR></DIV><DIV>Applescript for "cmd +":[^1]</DIV><DIV><BR></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" face="Monaco"> tell application "System Events"</FONT></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" face="Monaco">               <SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>key code 69 using command down</FONT></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" face="Monaco">      end tell</FONT></DIV><DIV><BR></DIV><DIV>And for "cmd  -"</DIV><DIV><BR></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" color="#000000" face="Monaco"><SPAN class="Apple-style-span" style="background-color: transparent;">   tell application "System Events"</SPAN></FONT></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" color="#000000" face="Monaco"><SPAN class="Apple-style-span" style="background-color: transparent;">                <SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>key code 78 using command down</SPAN></FONT></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" color="#000000" face="Monaco"><SPAN class="Apple-style-span" style="background-color: transparent;">       end tell</SPAN></FONT></DIV><DIV><BR></DIV><DIV>You can duplicate the "key code..." lines if you need.</DIV><DIV><BR></DIV><DIV>To make a TM command:</DIV><DIV><BR></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" color="#000000" face="Monaco"><SPAN class="Apple-style-span" style="background-color: transparent;">    osascript <<-APPLESCRIPT</SPAN></FONT></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" color="#000000" face="Monaco"><SPAN class="Apple-style-span" style="background-color: transparent;">    tell application "System Events"</SPAN></FONT></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" color="#000000" face="Monaco"><SPAN class="Apple-style-span" style="background-color: transparent;">                <SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>key code 69 using command down</SPAN></FONT></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" color="#000000" face="Monaco"><SPAN class="Apple-style-span" style="background-color: transparent;">       end tell</SPAN></FONT></DIV><DIV style="font-size: 11px; "><FONT class="Apple-style-span" color="#000000" face="Monaco"><SPAN class="Apple-style-span" style="background-color: transparent;">  APPLESCRIPT</SPAN></FONT></DIV><DIV><BR></DIV><DIV><BR></DIV><DIV>[^1]: I used the Numpad's  + and - codes (69 and 78) as I don't have a + key on my french kb (it's "shift ="). Most apps accept "cmd =" instead of "cmd +", but not TM, so I have this command triggered by "cmd =". ;)</DIV><DIV><BR></DIV><DIV><BR></DIV><DIV>--</DIV><DIV>FredB</DIV><DIV><A href="http://geekthang.com">http://geekthang.com</A></DIV><DIV><BR><BR></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR></DIV></BODY></HTML>