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

autohotkey if statement with and without curly braces

I don't understand the difference between Autohotkey's If and If(...) According to everything I have found, If(...) behaves as "expected" but there is something not working with my code. Below does not work. It seems the statement in the If is never…
LosManos
  • 7,195
  • 6
  • 56
  • 107
3
votes
4 answers

Autohotkey Single line code?

I have simple question that i can`t find answer by searching internet. How can I make my lines into one (single) line? for example this is a working code right:: Send, ^s Reload Send, hello world and this is not right::Send,…
Marco Polo
  • 71
  • 1
  • 5
3
votes
1 answer

ahk POST request using JSON issue

I'm developing REST API, and It should respond on request made by ahk script. I use node.js as server and mongodb as database. I tested POST my API in postman and it is working. But when I send POST requests from my ahk script, something goes…
3
votes
4 answers

How can autohotkey detect which virtual desktop you're on?

Hi I'm new to autohotkey (and programming in general) and I wanted to write a script that lets me conveniently switch to a specific desktop. For example, in my script Capslock+3 switches to desktop 3. As you can see or if you try it out, it's not…
aappletart
  • 41
  • 4
3
votes
1 answer

AutoHotKey - how to send control and same key multiple times

Specifically I want to hold down the control key, and press the m key, let go of m but keep control held down, and then press m again, which will trigger the function. More generically I'd like to know the syntax for telling autohotkey to read the…
Adam Diament
  • 4,290
  • 3
  • 34
  • 55
3
votes
1 answer

Autohotkey : Wildcard ahk_class match

I used winspy to grab an ahk_class for my autohotkey macro. Sometimes that application has 2+ ahk_classes associated with that program Example: HwndWrapper[program.exe;;1111-1111] HwndWrapper[program.exe;;2222-2222] How can I use winNotExist to…
Vincent Tang
  • 3,758
  • 6
  • 45
  • 63
3
votes
3 answers

Close specific chrome profile using AutoHotkey

I am new to AHK and am trying to remap some of my keys to open and close certain applications on my pc to make my life easier. One of them is Google Chrome, I managed to open the profile I want of chrome but I am having trouble closing that specific…
Adam Johns
  • 61
  • 2
3
votes
1 answer

How to remap a key using AHK to open and close Google Chrome

I am new to AHK and been trying to fidget around with it for quite some time, what I need to do is open a specific profile of Google Chrome when a key is pressed and if it's open close it when the same key is pressed. I tried many things but can't…
Adam Johns
  • 61
  • 2
3
votes
4 answers

How do I delete the current line using AutoHotkey?

Using an AutoHotkey script I'd like to set the keyboard command Ctrl+D to delete the current line in any active Windows app. How?
GollyJer
  • 23,857
  • 16
  • 106
  • 174
3
votes
1 answer

Google chrome - how to activate google chrome and switch to specific tab window?

On windows system, i have Python/QT GUI running. Now on button push i need to activate minimised or not minimised google chrome in front of my application. How to activate Google chrome and then switch to a very specific TAB by static title name or…
user285594
3
votes
1 answer

How do I add a delay between SendInput commands in AutoHotkey?

I have an AutoHotkey script using SendInput which sends MouseClick commands too quickly for my program to handle. My script will send a MouseClick to focus an input field, then start typing before the field finishes focusing. I've tried using…
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
3
votes
2 answers

How can I read multiple lines of user input in AutoHotkey?

I have an AutoHotkey script which needs to read multiple lines of employee data from a user. InputBox, userInput, Employee Records, Please enter employee records. (One per line) Unfortunately, an InputBox only allows users to enter a single line of…
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
3
votes
1 answer

How do I create a class in AutoHotkey?

I want to create a custom class object for an employee record in AutoHotkey. This class object would store an employee's age, name, and job title. For example, in Java: public class Employee { public int age; public String name; public…
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
3
votes
2 answers

How do I create a constant in AutoHotkey?

Many languages have methods for declaring constant values that can't be changed once created. public static final int MAX_TIME = 25; // Java const int MAX_TIME = 25; // C++ const MAX_TIME = 25; // JavaScript Is there…
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
3
votes
1 answer

What is the equivalent of Java's HashMap in AutoHotkey?

I have a set of abbreviated department names. I need to create a script which can map these abbreviations with their official titles. (For example: ADMIN → Administration) In Java I could accomplish this using a HashMap. public static void main() { …
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225