I want to make an AutoHotkey script to change the font in the PuTTY SSH client. (I prefer a small font for high information density, but when I'm showing something to a coworker, they need to be able to see it clearly.) I've gotten this far:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#SingleInstance force ; Lets the RunMe plugin for Notepad++ reload the script with Shift-F5.
#IfWinActive ahk_class PuTTY ; If PuTTY is active
^+1:: ; and Ctrl-Shift-1 is pressed
{
Send !{Space} ; Alt-Space to open the system menu
Send g ; open Change Settings
Send !g ; select the Category menu
Send w ; select the Window category
Send {Right} ; expand the category
Send a ; select the Appearance subcategory
ControlClick, ClassNN Button8, ahk_class PuTTYConfigBox, , Left, 1
}
#IfWinActive
When run from a PuTTY terminal window, everything up through "Send a" navigates the PuTTY menus as expected, bringing me to the Appearance subcategory. At this point I want to click the "Change..." button to set the font. I'd prefer not to send a bunch of tabs or specify a screen coordinate to select the button; as that seems kludgey and likely to break with future updates. I can't get ControlClick to work, though. The line I used above is my best guess after a couple hours of research, and I can't see why it does nothing.
Here's the Window Spy output when I'm hovering over the button:
>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
PuTTY Reconfiguration
ahk_class PuTTYConfigBox
>>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
On Screen: 1051, 207 (less often used)
In Active Window: 432, 202
>>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<
ClassNN: Button8
Text: Change...
Color: 0xF0F0F0 (Blue=F0 Green=F0 Red=F0)
>>>>>>>>>>( Active Window Position )<<<<<<<<<<
left: 619 top: 5 width: 456 height: 438
>>>>>>>>>>>( Status Bar Text )<<<<<<<<<<
>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
&Apply
&Cancel
Cate&gory:
Cursor appearance:
B&lock
&Underline
&Vertical line
Cursor &blinks
Adjust the use of the cursor
Fo&nt used in the terminal window
Font: Lucida Console, 24-point
Change...
Allow selection of variable-pitch fonts
Font &quality:
Antialiased
Non-Antialiased
ClearType
Default
Font settings
Hide mouse &pointer when typing in window
Adjust the use of the mouse pointer
Gap b&etween text and window edge:
&Sunken-edge border (slightly thicker)
Adjust the window border
>>>>>>>>>>>( Hidden Window Text )<<<<<<<<<<<
>>>>( TitleMatchMode=slow Visible Text )<<<<
1
>>>>( TitleMatchMode=slow Hidden Text )<<<<
Thanks for your help.