There are couple convenience functions, but not sure if these will stay around or maybe we’ll add more, depending on feedback. Right now, these are implemented by iterating over all window handles and filtering with Python.ĪHK.find_windows returns a generator filtering results based on attributes provided as keyword arguments.ĪHK.find_window is similar, but returns the first matching window instead of all matching windows. Currently, there is limited support for interacting with windows in actionchains, you may want to use win_set) find_window/find_windows methods ¶ Just like anywhere else, scripts running simultaneously may conflict with one another, so using blocking interfaces is perform () # *now* each of the actions run in order You can also suspend AutoHotkey from here for a period of time or even exit if you don’t need to run scripts. mouse_move ( 500, 500, speed = 10 ) # not yet ac. AutoHotkey Tutorial First of all, you have to download AutoHotKey and install it on your computer.Its program icon will sit in the system tray, from where you can control all your scripts. Hovering over this icon with your mouse will pop up a tooltip showing the name of the script. When the script is running, you should see a small icon in your system tray. Simply double-click the AHK file to run it. sleep ( 1 ) # still nothing happening ac. You should now have an AHK file somewhere on your system, and AutoHotkey all set up. mouse_move ( 100, 100, speed = 10 ) # nothing yet ac. maximize () Screen ¶įrom ahk import ActionChain ac = ActionChain () # An Action Chain doesn't perform the actions until perform() is called on the chain ac. active : # Check if window active window. rect ) # (x, y, width, height) print ( window. title ) # Some more attributes print ( window. always_on_top = True # Make the window always on top for window in ahk. to_bottom () # Move the window to the bottom of the other windows win. to_top () # Move the window on top of other windows win. disable () # Make the window non-interactable win. activate_bottom () # Give the window focus win. send ( 'hello' ) # Send keys directly to the window (does not need focus!) win. find_window ( title = b 'Untitled - Notepad' ) # Find the opened window win. run_script ( 'Run Notepad' ) # Open notepad win = ahk.
0 Comments
Leave a Reply. |