AutoHotKey

Communicating between Autohotkey and python

℡╲_俬逩灬. 提交于 2019-12-03 12:45:34
Is there a way to send some parameter from autohotkey to python. Using Autohot key I read some number from the notepad and store in a variable and now I want to send this number to the python code in order to do some calculations. My Autohotkey code is: controlGetText, telphoneNumber, Edit1, Untitled - Notepad And I want to send this telphoneNumber to python file. Is there a way I can do that? Do I need to create an exe file of a python and then call from autohotkey? For example: RunWait, C:\Button\button.exe telphoneNumber Or do I need to run command prompt commands from autohotkey to run

Syntax Highlighting in Notepad++: How to treat a user-defined language as built-in?

蓝咒 提交于 2019-12-03 12:36:19
问题 This is a very minor issue that has nonetheless annoyed me for months. I've spent hours Googling it to no avail. To enable syntax highlighting of .ahk files in Notepad++, I've downloaded & imported an .xml file for AutoHotkey. The issue is that- to enable this highlighting- I have to manually select it from the "Language" drop-down. I'd like to it to be enabled whenever an .ahk file is opened, as it is for various other languages. I've tried adding the .ahk extension to the AutoIt language in

How can I mimic Visual Studio's “Ctrl-K, C” two-step macro behaviour using Autoit / Autohotkey?

谁都会走 提交于 2019-12-03 11:34:27
问题 I'm trying to set up AutoHotkey macros for some common tasks, and I want the hotkeys to mimic Visual Studio's "two-step shortcut" behaviour - i.e. pressing Ctrl - K will enable "macro mode"; within macro mode, pressing certain keys will run a macro and then disable 'macro mode', and any other key will just disable macro mode. Example - when typing a filename, I want to be able to insert today's date by tapping Ctrl - K , then pressing D . Does anyone have a good example of a stateful

Holding down the left mouse button in AutoHotkey

回眸只為那壹抹淺笑 提交于 2019-12-03 10:38:26
I want a script where pressing F1 makes AutoHotkey hold down the left mouse button. I then want the script to release the mouse once I press the key again. How can I do that? DaMacc I would use Click down and Click up Click is generally preferred over MouseClick because it automatically compensates if the user has swapped the left and right mouse buttons via the system's control panel. F1:: alt := not alt if (alt) { Click down } else { Click up } Return Here is a one-liner in case anyone is interested: F1::Click % GetKeyState("LButton") ? "Up" : "Down" Mmm, I am a bit rusty in AHK programming,

Get the content of any active window

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am struggling to find a reliable way to get the content/text of the window that is currently in the foreground. It should be able to determine the text from every possible program that a user is currently using, if possible What I tried: Take a screenshot of the currently active window, apply some filters and run an OCR algorithm (tesseract .Net wrapper). This works, but takes a long time and is not very accurate. Then I tried some Windows API functions (FindWindow and SendMessage), as described here . I could make it run for the standard

How can I maximize a window across multiple monitors?

北城余情 提交于 2019-12-03 09:00:53
问题 Using AutoHotkey, How can I bind a hotkey to stretch/maximize/span a window across multiple monitors so that it covers both displays? Right now, I have to do this by manually stretching the windows with the mouse. I know there are dedicated tools that do this, but I'm already running an AutoHotkey script and would rather limit the number of tools I keep running. 回答1: Here's how I did it, mapping the Shift + Windows + Up combination to maximize a window across all displays. This compliments

Why does AutoHotkey respond with a “System cannot find the file” error?

匿名 (未验证) 提交于 2019-12-03 08:51:18
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to AutoHotkey and cannot understand why this script is giving me the error: Failed to launch program or document Action: <C:\Windows\System32\msg.exe> Params: <* "Initiated."> Specifically: The system cannot find the file specified. Here is the simple script in my test.ahk file: Run, "C:\Windows\System32\msg.exe" * "Initiated." I've verified that the msg.exe file is in the c:\Windows\System32 folder and I can run it without the script from both a command prompt and by clicking on the msg.exe program. I can also create a shortcut for

Relief from backslash irritation in R for Windows

坚强是说给别人听的谎言 提交于 2019-12-03 08:08:38
Early in my R life I discovered the pain of R and windows being on different pages when it came to the separator between directories and subdirectories. Eventhough I know about the problem, I am still pained by manually having to put a backslash in front of all my backslashes or replacing all of them with forward slashes. I love copying a path name or an entire filename with any one of several applications that I have running on my computer (eg. XYPlorer, Everything by voidtools) and then pasting it into Tinn-R. Is there anyway that I could automate the task that I am currently doing manually.

Python for Autohotkey style key-combination sniffing, automation?

为君一笑 提交于 2019-12-03 03:21:20
问题 I want to automate several tasks (eg. simulate eclipse style ctrl - shift - R open dialog for other editors). The general pattern is: the user will press some key combination, my program will detect it and potentially pop up a dialog to get user input, and then run a corresponding command, typically by running an executable. My target environment is windows, although cross-platform would be nice. My program would be started once, read a configuration file, and sit in the background till

Dynamically Create AutoHotkey Hotkey to Function/Subroutine

若如初见. 提交于 2019-12-03 03:18:48
The AutoHotkey command Hotkey allows for the creation of dynamic hotkeys at runtime, but its syntax and documentation seems to limit it to built-in or existing labels/subroutines, which makes it much less useful: Hotkey, KeyName [, Label, Options] Is there a way to get it to work like regular, hard-coded hotkeys? For example: #z::MsgBox foobar ; Typical, hard-coded hotkey pops up a message-box Hotkey, z, MsgBox foobar ; Nope; complains about missing label “MsgBox foobar” It looks like it might be possible due to the following line from the manual, however it is not clear how it would work: