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.

AutoHotkey also has a very friendly and helpful community.

Resources

1349 questions
29
votes
1 answer

How do I escape the '{' and '}' characters in an AutoHotKey script?

I'm trying to write a simple auto-replace script but can't find how to insert the '{}' characters. The usual escape characters (backtick ` or backslash ) don't seem to work for curly brackets. e.g.…
pelms
  • 9,331
16
votes
4 answers

script to restore/bring to front of a program, or open it if it is not active

I am trying to develop a script that should do the following. For example, !W should: check if Word is active (can be open or minimized) if it is minimized, it should be restored to the size and location it had before minimization if it is open,…
Peter Verbeet
  • 303
  • 1
  • 2
  • 7
16
votes
1 answer

How to combine three keys as a hotkey with Autohotkey?

I want to combine CapsLock Alt k keys in a single hotkey, such as this: CapsLock & !k:: Send !{Up} This doesn't work because Autohotkey doesn't allow the combination of more than two keys except the modifier keys. Searching for a solution I found…
Mert Nuhoglu
  • 2,390
14
votes
5 answers

How can I use the keyboard to simulate mousewheel scrolling with AutoHotkey?

I'm looking for a way to scroll with the keyboard using AutoHotkey. It would be also great if I could tweak scrolling speed somehow.
Jarek
  • 1,743
13
votes
1 answer

AutoHotkeyA32 vs. AutoHotkeyU32 vs. AutoHotkeyU64

The portable .zip archive for AutoHotkey contains 3 executables: AutoHotkeyA32.exe, AutoHotkeyU32.exe, and AutoHotkeyU64.exe. Based on the filenames, I assumed 32 and 64 refer to 32-bit and 64-bit respectively, while A and U refer to Admin and User…
Stevoisiak
  • 14,394
  • 40
  • 103
  • 163
12
votes
1 answer

How can I make multi-line AutoHotKey scripts more readable?

I want to create an AutoHotKey script that generates this text: ==videoReview aspnetmvc IDCODE TITLE DESC 10:00 viewable online [[ ]] 3 english extras::$url=nnn;$reason= Using a similar tool called Texter, I define it like…
9
votes
5 answers

AutoHotkey: how to assign a command to the "Calc" key?

how do i assign commands to the "calculator" or "favorite" keys with autohotkey?
RCIX
  • 5,775
8
votes
1 answer

AutoHotkey script for 'right click context menu' command

I am using a Macintosh keyboard on Windows and would like to create a hotkey so that I can turn ctrl and some other other button into the “right click context menu” button of non-mac keyboards. What would such a script look like? Let’s say I want to…
Jonny
  • 231
8
votes
2 answers

How do I create a hotkey for a sequence of inputs while holding Ctrl, e.g. {Ctrl Down}ec{Ctrl Up}?

For example, in Visual Studio Express 2013, many of the formatting shortcuts have been "folded" into Ctrl+E. To comment a selection, one would hold down Ctrl, hit E, hit C, then release Ctrl.      If I were sending such input, I'd write SendInput…
8
votes
5 answers

Need Autohotkey to center active window

I'm looking for a way to center the active window on the desktop using Autohotkyes. Can someone give me a script that I could use please. Thanks
Carlos
  • 311
8
votes
2 answers

How to pass command-line arguments to AHK script?

I'd like to run the AHK script with arguments, like: AutoHotkeyU64 file.ahk arg1 arg2 Then access these variables as part of the script, e.g. MsgBox, %arg1%, %arg2% How this can be achieved?
kenorb
  • 25,417
7
votes
2 answers

How can I define the cursor position in a AutoHotKey script?

I wrote a AutoHotKey script to print out these four lines: ==quote web 12 but I want the cursor to be blinking between the line "web" and the line "12", I would think I could include the word "Cursor" like…
6
votes
1 answer

How to send/type a colon

I wish to send the following string to cmd: C:\xampp\mysql\bin\mysql.exe -u root The problem is to send the colon, I tried Send, c:Send, \xampp\mysql\bin\mysql.exe -u root and Send, c{:}Send, \xampp\mysql\bin\mysql.exe -u root But they all turn…
fall
  • 217
6
votes
1 answer

Using Different Mappings for Uppercase and Lowercase of the Same Key

I'm trying use AutoHotkey to map some key combinations in a way that respects upper and lowercase, but I cannot get it to work. For example: I want: AppsKey + L types "a" AppsKey + Shift + L types "b" My failed attempts: A. Both combinations only…
Kaypro II
  • 1,492
6
votes
3 answers

Replace [ with { and ] with } using AutoHotkey

I found that in coding I rarely use the square braces [] but use the curly braces {} often. On most keyboards, these are inputted using Shift+[ or Shift+]. Now I tried to use AutoHotkey to remap these keys by using: [::{{} Adding {} is raw mode…
darren
  • 61
  • 1
  • 2
1
2 3
22 23