Sujet : Re: Anyone still use only use the Terminal?
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.miscDate : 26. Apr 2025, 13:49:06
Autres entêtes
Organisation : Stefan Ram
Message-ID : <AHK-20250426133630@ram.dialup.fu-berlin.de>
References : 1 2 3 4 5
Borax Man <
rotflol2@hotmail.com> wrote or quoted:
For example, at work, I often have to do repetive work (such as generate
specifications). This involves a lot of bring up dialog boxes, clicking
options, saving files, changing filenames, over and over and over again.
On Windows one also can access the screen programmatically with code
that goes somewhat like, "If there is a dialog of this class on the
screen, then press its [OK] button. Wait one second. Wait until a
Window with 'editor' in its title comes up. Then press [Ctrl]-[F]."
This kind of programming is what AutoHotKey (AHK) on Windows
was made for, but it's also possible from other programming
languages (like Python) on Windows. When using AHK, you can
set up a keyboard shortcut to start such code. AHK examples:
^F16:: ; whenever Ctrl-F16 is pressed:
Send, `q ; press q
Sleep, 250 ; wait 0.25 seconds
Send {F2} ; press F2
F17::
WinGetPos, winWidth, winHeight, , , A ; get position of active window
if ( winWidth == -4 and winHeight == -4) { . . .
Disadvantages: You have to take time to actually write such code,
and there's some risk that it inadvertently might press a wrong
button with unforeseeable consequences.