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
8
votes
3 answers

autohotkey ctrl+click = right click

What would be the code to turn a control+click to a right click? I'm running windows 7 on a mac and would like to control click on the track pad rather than doing a two finger click.
user247298
  • 429
  • 1
  • 7
  • 17
8
votes
4 answers

Remove single line breaks, keep "empty" lines

Say I have text like the following text selected with the cursor: This is a test. This is a test. This is a test. This is a test. I would like to transform it into: This is a test. This is a test This is a test. This is a test In other…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
7
votes
2 answers

Sending email via ahk with emoji produces issues

I use an ahk script to send regular emails that works fine (will post the entire script at end of question). I am now setting up a script that will send HTML formatted emails. The only change you need to make to send HTML formatted emails is…
Zvi Twersky
  • 399
  • 1
  • 5
  • 25
7
votes
3 answers

How do you remap alt+tab in autohotkey?

How do you make your alt+tab functionality work like OSX where it uses meta+tab and not alt+tab, while also respecting the shift key? I have the solution for this. Note the date of this post because I've gone through many apparently obsolete…
Tim
  • 6,265
  • 5
  • 29
  • 24
7
votes
2 answers

Setting breakpoints in Visual Studio Code for Autohotkey scripts

This AutoHotKey (AHK) forum post ends with suggesting there is no current way to set breakpoints for an Autohotkey script in Visual Studio Code. The post ends suggesting that Xdebug may work. Is anyone in this forum aware of any way to set…
Thinker
  • 71
  • 1
7
votes
2 answers

What does the comma after a command do?

The AutoHotkey Beginner Tutorial starts off with an example using the Send command, with the command and its argument separated by a comma: ^j:: Send, My First Script Return ... SEND is the command, anything after the comma (,) will be…
Mark Amery
  • 143,130
  • 81
  • 406
  • 459
7
votes
1 answer

How do I print an array in AutoHotkey?

I have a set of arrays in AutoHotkey which I want to display as strings for debugging. strArray := ["Alice", "Mary", "Bob"] ; 1D array strArray2D := [[1,2,3], [4,5,6]] ; 2D array In Java, Javascript, and AutoIt I can accomplish this with the…
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
7
votes
3 answers

How to add administrator privileges to AutoHotkey script?

I compiled it to an executable, but to open it I have to right-click and press "Run as administrator". I want it to request admin privileges each time I run it, but how to do it? I can't do this: Because then it doesn't work when I copy it to a…
barteczek56
  • 95
  • 1
  • 1
  • 7
7
votes
3 answers

Autohotkey script for muting speakers for a certain number of seconds

I'm trying to use Autohotkey to create a script that will Mute the computer's speakers for a number of seconds. This is useful for watching television online -- when it comes to a commerical, it will give a message saying 'programming will resume…
kilien
  • 81
  • 3
7
votes
1 answer

What is the Function key called in AutoHotkey?

I have a key labelled Fn in blue letters at the bottom of my Windows 7 keyboard. I want to trigger my AutoHotkey script whenever someone presses that key. What is the Function key called in AutoHotkey?
Antp
  • 255
  • 1
  • 4
  • 12
7
votes
3 answers

Killing processes - AHK

So far I have: Process, Exist notepad.exe Process, Close, %p_id% How do you set ahk to kill the process if it exists? I read it's something to do with the PID, but don't know how to implement that.
Armad X
  • 73
  • 1
  • 1
  • 7
7
votes
1 answer

Autohotkey How to hold a mouse button while a key is pressed?

In short: How do I write an autohotkey script so that when I press, say, F1, it presses the mouse button down and only lets it go after I let go of the key? I did some research on both autohotkey forums (which redirect here for asking questions) and…
Fum
  • 73
  • 1
  • 1
  • 3
7
votes
4 answers

AutoHotKey keystroke break loop

Using AutoHotKey, I have a rather simple loop script that I want to be able to break by the stroke of a key. I tried a few different codes from websites but it doesn't seem to work. Here's the code: #g:: Loop 20 { MouseClick, left, 142, 542 …
Dave
  • 71
  • 1
  • 2
7
votes
6 answers

Capture CMD output with AutoHotkey

I'm trying to read Windows CMD's stdout with AutoHotkey. For example, I'd like to have the output of the setconsole command inside AHK stored in a variable. I already achieved it a while ago, which makes me all the more perplex why it's not working…
MCL
  • 3,985
  • 3
  • 27
  • 39
7
votes
1 answer

Autohotkey: get list of windows with a certain title

I'm making an AutoHotkey script that, when a window with a certain title or class ID appears, draws a region inside it. The problem is that sometimes multiple such windows can appear, all having the same title and class ID. In that case my script…
Jackie Spazz
  • 73
  • 1
  • 4