Questions tagged [autohotkey]

AutoHotkey (AHK) is a free, open-source macro-creation and automation software for Microsoft Windows that allows users to automate repetitive tasks. It is driven by a scripting language that was initially aimed at providing keyboard shortcuts, otherwise known as hotkeys, that over time evolved into a full-fledged scripting language.

AutoHotkey (AHK) is a free, open-source macro-creation and automation software for Microsoft Windows that allows users to automate repetitive tasks. It is driven by a scripting language that was initially aimed at providing keyboard shortcuts, otherwise known as hotkeys, that over time evolved into a full-fledged scripting language.

AutoHotkey can be used to:

  1. Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or a macro recorder.
  2. Remap keys and buttons on your keyboard, joystick, and mouse.
  3. Create hotkeys for keyboard, joystick, and mouse. Essentially any key, button or combination can become a hotkey.
  4. Automate almost any kind of GUI.
  5. Retrieve and change the clipboard's contents.
  6. Opening programs, documents, and websites with simple keystrokes.
  7. Monitoring a system and automatically opening wanted and closing unwanted programs.
  8. Scheduling an automatic reminder, system scan, or backup.
  9. Creating text replacement task or automatic spelling corrections.
  10. Convert any AHK script into an executable file that can be run on computers where AutoHotkey is not installed.
  11. Create simple GUI tools.

AutoHotkey also has a very friendly and helpful community.

Resources

4574 questions
4
votes
2 answers

Passing alt-tab to Emacs inside Screen inside Putty

I run terminal-mode Emacs (using the -nw option) inside Screen on my office Debian box. This way, I can log in my box with ssh from anywhere and work even with slow or intermittent connection. When I log in from Windows using Putty, I miss the…
4
votes
1 answer

Konami Code on autohotkey

up up down down left right left right b a enter :: Msgbox, konami code. is there a way to do this?
Snob
  • 71
  • 5
4
votes
1 answer

How can I activate specific tabs in Chrome or Firefox with AutoHotkey?

I have 20 different tabs I'd like to be able to open by simply hitting Ctrl+A The following works for the first 9 tabs, but not beyond that #SingleInstance, Force #IfWinActive, ahk_exe chrome.exe ^a::Send, ^2 So I read I'm supposed to use…
user3411784
  • 43
  • 1
  • 5
4
votes
1 answer

Autohotkey, highlight text without mouse and original arrow keys?

I remapped my arrow keys to ijkl this way, !j::send {Left} !k::send {Down} !l::send {Right} !i::send {Up} It works great but in notepad, google docs etc I wish to highlight some text without using my mouse or the original arrows keys. Is this…
schneo
  • 43
  • 4
4
votes
1 answer

Why is my instance variable acting like a class variable in AHK?

Here is the basic structure of what I am trying to do: OutputDebug % "~~~~~ START ~~~~~" tempA := new ClassA() tempB := new ClassB() tempC := new ClassC() tempA := 0 tempB := 0 tempC := 0 OutputDebug % "~~~~~ END ~~~~~" return class Base { …
Paige DePol
  • 1,121
  • 1
  • 9
  • 23
4
votes
2 answers

In AutoHotKey, how do I block LButton from being sent if it's used in the hotkey context but not if it's used elsewhere?

I have this script: ~LButton & RButton:: Click Middle Return Supposedly when I press LButton and RButton together, they'll work as the MButton. This does work but it sends the LButton as well. If I remove the ~ from the hotkey prefix, LButton…
user400424
  • 373
  • 3
  • 15
4
votes
2 answers

How does autohotkey's asynchronous execution work?

This is sample program I found that will allow you to toggle some loop action: ; This toggles the action toggle:=false F12:: ; If true is assigned to toggle, loop starts ; It also can assign false even when loop is running If (toggle := !toggle) …
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
4
votes
2 answers

When should `Sent` be used over `SentInput` in Autohotkey?

The Autohotkey documentation writes: SendInput is generally the preferred method to send keystrokes and mouse clicks because of its superior speed and reliability. Under most conditions, SendInput is nearly instantaneous, even when sending long…
Christian
  • 25,249
  • 40
  • 134
  • 225
4
votes
3 answers

RegEx: Match everything up to the last space without including it

I'd like to match everything in a string up to the last space but without including it. For the sake of example, I would like to match characters I put in bold: RENATA T. GROCHAL So far I have ^(.+\s)(.+) However, it matches the last space and I…
menteith
  • 596
  • 14
  • 51
4
votes
1 answer

Generate timed-text synchronised with Text-to-Speech word-by-word?

How can I generate timed-text (e.g. for subtitles) synchronised with Text-to-Speech (TTS) word-by-word? I'd like to do this using the high quality SAPI5 voices (e.g. those available from IVONA here) and that I have used on Windows 10. On Windows we…
GavinBrelstaff
  • 3,016
  • 2
  • 21
  • 39
4
votes
2 answers

WinHttpRequest timeouts

I'm using AHK script to send some POST requests. I'm trying to get a timeout response so I can popup some message to the user. I cant figure out how to use the "SetTimeouts" method and the "WaitForResponse" See code below WebRequest :=…
bardalas
  • 81
  • 1
  • 1
  • 10
4
votes
2 answers

Trigger AHK script based on the position of the mouse

Is it possible to trigger an AHK script based on the position of the mouse? Say, if I wanted to press a button or series of buttons on my keyboard if I move my mouse to the corner or edge of the screen. Also, can this be done multiple times per…
Aaron Franke
  • 3,268
  • 4
  • 31
  • 51
4
votes
2 answers

How to have Autohotkey 'listen' for a change to a file?

I have a text file, lets call it C:\to_run.txt. I'd like my Autohotkey script to 'listen' to this file in such a way that when it detects a change, it performs an action immediately based on the contents of the file, and then make the file blank…
brollin
  • 110
  • 1
  • 11
4
votes
1 answer

Fetch the current track info from Spotify app after March 2015 update

I want to pull out the current track information from Spotify windows client using autohotkey. Although this question Hotkey for next song in Spotify solved some of the problems (the media playback issues) in the commonly used ahk script (can be…
otterb
  • 2,660
  • 2
  • 29
  • 48
4
votes
1 answer

Alternative to UrlDownloadToFile

UrlDownloadToFile is a nice command in AutoHotkey and works just fine, most of the time, but sometimes a download mechanism is too complex for it. For example if the download requires a specific user-agent to be set or if the download requires a…
Forivin
  • 14,780
  • 27
  • 106
  • 199