2
1
Is there a way to retrieve the contents of the Putty buffer from an AutoHotKey script? For many applications, WinGetText works, but it doesn't seem to for Putty. Also, the AHK Windows Spy doesn't display any text from the buffer, so I suspect that Putty simply uses a different method of storage/display for it's buffer.
I'm wondering if either you can enable a setting in Putty such that it will expose the contents of it's buffer in a Window-standard way that AHK could then pick up as the Visible Window Text.
Alternatively, I suppose there may be some feature of AHK that I'm not aware of that can get that text, but that seems less likely.
1What are you trying to do overall? – bobmagoo – 2012-08-21T00:12:17.753
Attachmate Reflections macros can be set up to wait until it sees certain text in the screen before it does a "Send". So if I want to have AHK automatically enter my username at a prompt, I can have the AHK script wait until the "Username:" prompt displays (for, say, a db login). I'm currently using AHK "Send", in combination with sleep,100 to handle the case where a database login prompt is slow to load (I have a db login script set to run from .profile at login). – Cooper – 2012-08-24T20:51:59.807
I mean, overall, what are you trying to accomplish? Automatically connect to a database? Send something? – bobmagoo – 2012-08-25T13:05:45.173
Yes - I want to automatically connect (and login) to a database. This involves navigating a series of text menus as well. – Cooper – 2012-09-06T15:37:47.800
What database are you connecting to? From what? Surely there's an easier way to connect to a database than screen scraping. – bobmagoo – 2012-09-06T16:11:09.997
We have many customers, and each customer has a customized series of text menus that need to be navigated to select the correct database environment (multiple can be hosted on one server). At the end, once you've selected the correct environment, I'd like to enter username and password. These text menus are driven by fairly large perl scripts, which I'd like to avoid pulling apart for each customer just to streamline my logins. – Cooper – 2012-09-10T20:38:49.287