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
6
votes
1 answer

Send contents of clipboard as keystrokes in AutoHotkey

I'm looking for a way to send the contents of the clípboard as key output. E.g. if the clipboard says "123456789" I want the keys 1-2-3-4-5-6-7-8-9 sent to the keyboard input. I've tried: SetWinDelay 100 SetKeyDelay 0 ^f:: Send…
abcde123483
  • 3,885
  • 4
  • 41
  • 41
6
votes
1 answer

How do I return a value from an AutoHotkey script?

I need to call an AutoHotkey script that will return a value. For example, something like this: return_val = Shell("AutoHotKey.exe script.ahk") My script looks like this: IfExists, filename return 1 Else return 0 I get an error telling…
anthv123
  • 523
  • 1
  • 8
  • 20
6
votes
2 answers

what is the '¬' character called and what is it for

I do not ever think I have ever had a need to type this character "¬", and so I was wondering what it is called and what it is for and why it is on the my keyboards (both my UK and EU keyboards)? I assume that it had some common function back in the…
YorSubs
  • 3,194
  • 7
  • 37
  • 60
6
votes
3 answers

convert ahk to python

I am learning both autohotkey and python. I wrote this script in ahk (and it works!) that automatically joins tables (using tableninja) in the pokerstars client-- ^q:: Loop { Send q Sleep 500 Send {PgUp} Sleep 500 Send w Sleep 60000 } return I'd…
Jim Syyap
  • 1,625
  • 7
  • 20
  • 23
6
votes
1 answer

Sending Keyboard inputs to Spotify whilst not in focus

I have an AHK script (below) which sends various commands to the Spotify desktop app globally while in the background to perform various actions, however I play an MMO which has an always running anti-cheat which shuts the game down when it detects…
Superduder
  • 61
  • 2
6
votes
4 answers

Can I run a python script from a keyboard shortcut?

I want to be able to run a python script like a keyboard macro, just by pressing a certain combination of buttons. Is it possible, if yes, how?
SSSNIPD
  • 93
  • 1
  • 1
  • 5
6
votes
2 answers

How remove email-address from string?

So, I have a string and I want to remove the e-mail adress from it if there is one. As example: This is some text and it continues like this until sometimes an email adress shows up asd@asd.com also some more text here and here. I want this as…
Harpo
  • 187
  • 1
  • 10
6
votes
2 answers

How to start night light via command in Windows 10?

How can I enable immediate light night setting in Windows 10 via a command? This is the setting from inside the "Night light settings" inside "Display" settings, and not the one from "Display" which only enable the general timed setting. Also a…
elig
  • 2,635
  • 3
  • 14
  • 24
6
votes
1 answer

How do I send the value of an array variable in Autohotkey?

I'm writing an AutoHotkey script which needs to display the value of an array variable, but it doesn't seem to be working properly. MyArray := ["one", "two", "three"] send MyArray[1] ; "MyArray[1]" send MyArray%1% ; "MyArray" send…
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
6
votes
1 answer

AutoHotKey to accurately log keystrokes

"I am trying to make an AutoHotKey program where I can play a game and it will record keypress/keyrelease events along with a millisecond timestamp so I can later repeat those exact actions in a secondary program. Ex. I play a game and the program…
Eric Hill
  • 63
  • 1
  • 5
6
votes
1 answer

How do I find the length of an associative array in AutoHotkey?

If you use the length() function on an associative array, it will return the "largest index" in use within the array. So, if you have any keys which are not integers, length() will not return the actual number of elements within your array. (And…
Fletcher VK
  • 63
  • 1
  • 4
6
votes
2 answers

Get Selected Text Without Using the Clipboard

I am trying to create a pretty basic text wrapper in AutoHotKey for use when programming. I got it to work using the clipboard to copy the selected text, modify it, then paste it, but I am trying to refrain from using the clipboard since it does not…
6
votes
4 answers

Run a powershell command through AutoHotKey script

I want to be able to run a following PowerShell command through AutoHotKey script: new-item -path c:\ -name logfiles -itemtype directory I am unable to find a way to achieve this task. Please help.
samisda1
  • 87
  • 1
  • 2
  • 6
6
votes
3 answers

AutoHotKey mapping

I am trying to map the following key combinations on my keyboard using AutoHotkey - Alt i -> Up Arrow Alt j -> Left Arrow Alt k -> Right Arrow Alt m -> Down Arrow I added the following code to my AutoHotkey.ahk file -…
Arunabh Das
  • 13,212
  • 21
  • 86
  • 109
6
votes
3 answers

Right Click on Tray Icon in Windows 10 with AutoHotKey

In Windows 7, I had an AutoHotKey script that would automatically Right-Click on a tray icon. #Include %A_Scriptdir%\TrayIcon.ahk TrayIcon_Button("CCC.exe", "R") Which used the TrayIcon.ahk library from FanaticGuru's post. This worked just fine on…
SimCard
  • 305
  • 3
  • 13