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

Replace multiple periods in string with just one period

I'm trying to replace any group of two or more periods with just a single period. I suspect the + operator is involved, but I've had nothing but sorrow trying to make the expression using that... So I thought as an experiment I would try to replace…
dwilbank
  • 2,470
  • 2
  • 26
  • 37
4
votes
1 answer

Alt + Space + key in autohotkey

How can I create an Alt + Space + C shortcut in autohotkey? Alt + Space is !space but I don't see how I can add a third key without getting an error.
Amati
  • 1,484
  • 1
  • 16
  • 29
4
votes
2 answers

How can I remap CTRL-x CTRL-c in Autohotkey?

Having recently moved to Emacs (and become a fanboy), I'd like to use Autohotkey to make Ctrl+X Ctrl+C a universal "Close" command. Here's what I have in my .ahk file: ; Universal Close :*:^x^c:: WinClose, A Return which doesn't appear to…
Brent.Longborough
  • 9,567
  • 10
  • 42
  • 62
4
votes
3 answers

AutoHotkey Remapping Korean Keys to Ctrl

There are two keys adjacent to the spacebar on standard Korean keyboards (one on each side) which I would like to remap to be Control or Alt modifiers - so I can alternate using a stronger finger than my pinky (I'm an emacs user). I'm guessing the…
assem
  • 2,077
  • 1
  • 19
  • 24
4
votes
1 answer

Autohotkey script running program with command line arguments

I am using autohotkey to automate some manual process. I have to run a java command line program(.java) that accepts couple of command line arguments. I want to run this java program from autohotkey after executing some pre-defined tasks in the…
Ghanta Sairam
  • 1,163
  • 3
  • 11
  • 13
3
votes
1 answer

Including Regular Expressions in AutoHotKey Script

I am currently developing a very "simple" script in AutoHotKey, but it involves using hotstrings following the format: ::btw::by the way which would detect whenever a user types "btw" and replace it with "by the way". However, whenever I try to put…
danielmhanover
  • 3,094
  • 4
  • 35
  • 51
3
votes
2 answers

How can I send Windows Media Keys from an Apple Keyboard

I'm using an apple keyboard with windows 7. I'd like the function keys labelled with 'media' functions (prev, pause/play, next, mute, vol-, vol+) to work like the equivalent keys on a windows keyboard. I've tried this autohotkey…
sw1nn
  • 7,278
  • 1
  • 26
  • 36
3
votes
2 answers

Sending keystrokes and mouse clicks using Scala

I've previously used AutoHotkey to send keystrokes and mouse clicks to automate interaction with GUIs and browsers. How do I send keystrokes and mouse clicks this time using Scala?
candleford
  • 251
  • 1
  • 2
  • 8
3
votes
3 answers

How do I check if a button exists on a window with AutoHotkey?

In my case, there are times that a certain button will exist and not exist. Is there a way to check whether a certain button exists on a window using AutoHotkey?
Manie
  • 2,028
  • 2
  • 16
  • 18
3
votes
2 answers

How to StringReplace a '\' with AutoHotkey?

Trying do do a simple StringReplace, clipboard, clipboard, \, /, All That code works w/ other characters, but gives an error with '\' and/or '/' also tried ASCII codes but those do not work either since % is a variable in AHK. How to StringReplace…
This_Is_Fun
  • 183
  • 3
  • 12
3
votes
1 answer

Subtracting Variables with Autohotkey

I am building a macro in Autohotkey which requires me to subtract a number from a variable, as shown below: screenWidth = 1280 MsgBox, screenWidth - 150 For some reason, whenever the dialog box appears with the message, all I get is screenWidth -…
Oliver Spryn
  • 16,871
  • 33
  • 101
  • 195
3
votes
1 answer

type to controls on locked workstation?

I'm using AutoHotKey Send command http://www.autohotkey.com/docs/commands/Send.htm to type to controls. It works fine, but it doesn't work if the workstation is locked. But I need to type to controls on locked workstation. If AutoHotKey can not do…
Oleg Vazhnev
  • 23,239
  • 54
  • 171
  • 305
3
votes
1 answer

How to load an autohotkey file into another autohotkey file (.ahk)

I am working on a autohotkey script that will allow me to select text/code tomy clipboard and hit a keyboard combination, it will then post it as a new entry on the pastbin.com website under my account and return the URL for the new pastebin.com…
JasonDavis
  • 48,204
  • 100
  • 318
  • 537
3
votes
4 answers

change emoji key to ctrl in Microsoft designer keyboard with autohotkey

A few days ago I bought Microsoft designer keyboard https://www.microsoft.com/en-us/d/microsoft-designer-compact-keyboard/8zhrtr7zcswq?activetab=pivot:overviewtab it has emoji key but it's not useful at all... so I decide to change it to ctrl and…
Raskul
  • 1,674
  • 10
  • 26
3
votes
1 answer

How to send WM_COPYDATA from C++ to AutoHotKey?

Trying to SendMessage with WM_COPYDATA from a C++ application to an AutoHotkey script. I tried to follow the example found in the docs: https://learn.microsoft.com/en-us/windows/win32/dataxchg/using-data-copy Then I did: HWND htarget_window =…
user14766639