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.

Filter by
Sorted by
Tagged with
9 votes
2 answers
5k views

Windows virtual desktops. Cycle back to first desktop at end

Let's say I have three virtual desktops. I know I can navigate through them using: ctrl + windows + left | right However, is there a way to make it cycle back through to the beginning if I reach the ...
0 votes
1 answer
24 views

Disable horizontal (left/right) mouse input during specific key press (toggle) or key hold

In Windows 10, I am looking for a way to disable any input from my mouse's movement in the horizontal or left/right direction while still allowing the input in the vertical or up/down direction to be ...
0 votes
0 answers
7 views

Automate form fill, with email on certain result

I am aware of several methods for auto-filling a multi-page form in a browser, including Autohotkey and Selenium IDE, but I am stuck with regards the final step: I need to send a simple email if the ...
1 vote
1 answer
23 views

Add characters on multiple lines

AHK newbie here, My problem is simple, I want to make a script that transforms a text with a hotkey. Default text : AAA : aaa BBB : bbb CCC : ccc Transformed text : <br><br> <u>...
15 votes
4 answers
7k views

How do I disable specific windows 10/Office Keyboard Shortcut (CTRL+SHIFT+WIN+ALT+D)

it seems that Office has decided to hi-jack the keyboard shortcut CTRL+ALT+SHIFT+WIN+D. That might not seem like a problem, but I have assigned that keyboard shortcut in AutoHotKey and have been ...
0 votes
1 answer
28 views

moving a control inside an application [closed]

I wanted to know if there is any tool that can allow me to move UI elements inside an application using script? The details: My father has glaucoma and his field of sight is very limited towards its ...
0 votes
2 answers
154 views

Windows - Alt Click on a window to close window under the mouse cursor

Is it possible to close a window, simply by clicking anywhere inside it? Hold down alt key, and click the windows you want closed. Much like shooting targets in a game. Why not Alt+F4? This would be ...
0 votes
0 answers
15 views

How to disable CTRL key when it is the only one key being pressed in Photoshop to disable "Switch To Move Tool" function

I want to disable the press Ctrl to switch to move tool function. And keep other hotkeys combine with Ctrl still function properly. eg.Ctrl+Z I have tried the script below but it does not work. #...
0 votes
0 answers
18 views

Open Chrome with Razer Synapse without cmd showing up

I got a new keyboard and I am trying to switch from AutoHotkey to Razer Synapse, most shortcuts I needed work well but when I am trying to open something in macro a cmd window opens immediately. For ...
0 votes
1 answer
20 views

How do I assign "Switch to Virtual Desktop 1 (2/3/4)" to F1 (F2/F3/F4) in Windows 11?

My fastest way of working is not to have 4 monitors (swiveling or rotating the head takes at least half a second) but to have fixed Virtual Desktops for specific tasks. So I know "Webbrowser: 3rd ...
0 votes
1 answer
5k views

What's the utility of the return command in autohotkey?

In the instances where the return command returns a value, the utility is obvious. I have seen the return command being used even when it is seemingly unnecessary. Let me show the following examples: ...
0 votes
1 answer
52 views

AHK and drive safety when constantly writing to disk

First of all am fairly new to all this, so please bear with me. I am in a situation where I need to constantly write the contents of a variable to an INI file located on the C: drive. By constant I ...
0 votes
0 answers
49 views

AHK: Open folder or active it if opened

I'm using autohotkey and try to do this: Open download folder (Q:\Down in my case) or active it if already opened (subfolders don't count, for example still open Q:\Down if I opened Q:\Down\phvideos ...
1 vote
1 answer
3k views

How to Remap a Program to lock Windows (Win+L)

I'm trying to remap WinLock to something new. Basiclly i want to remove Win+L to lock Windows and add Win+L to Open a specific program to be opened. Any Help ? Thanks. PS: currently i using #L::Run "...
0 votes
0 answers
30 views

Sending Keystrokes/Macro to a connected device?

Currently I'm trying to automate a bit of work I've been handed. Basically, it's a device where I need to put in the same values over and over again, though with a variable for it (Serial and MAC). ...
0 votes
1 answer
23 views

Mapping every key into a modifier when pressed with another

It has become common to e.g. map Caps Lock to Ctrl as a modifier / Esc when pressed alone. I had an idea to do a similar thing with regular keys, e.g. j+w -> Ctrl+w, but j when pressed alone. I ...
2 votes
1 answer
3k views

How to edit/change/modify the Syntax Highlighting Color in VS Code

How to edit/change/modify the Syntax Highlighting Color in VS Code, ie for Autohotkey and/or Markdown languages? For example: Im using the High Contrast theme (black background), and in that theme, ...
0 votes
1 answer
66 views

How can I prevent the 0x80004005 error from appearing when I run AutoHotkey code?

#IfWinActive, ahk_exe explorer.exe ; only for explorer ^sc07B:: selected = % Explorer_GetSelection() ; get currently selected item in explorer as source ;*[test] ...
46 votes
14 answers
14k views

What to do when I need more keys than my keyboard has?

I have a standard keyboard. With AutoHotKey, I have mapped F1 to F12 to perform extremely specific tasks which I have muscle-memorized, and in addition to these, I have numerous WinKey+Letter ...
2 votes
1 answer
3k views

AHK is possibe to make this script works in inactive window

Is it possible to make this script work in a specific inactive/minimized window. ? loop { dllcall("keybd_event", int, VK, int, SC, int, 0, int, 0) dllcall("keybd_event", int, VK, int, SC, int,...
3 votes
1 answer
156 views

How to split multi-line clipboard data (e.g. from Excel) in single-line "pastes", one CTRL+V at a time

To illustrate my dilemma as simply as possible: I have a list of values ranging from 1-10 that I want to copy and store. When I press Ctrl+V (or any paste execution), I want 1 to be displayed. When I ...
17 votes
3 answers
25k views

Open Powershell as Administrator at Current File Explorer Directory Keyboard Shortcut (Windows 10)

Let's say that I'm browsing through Windows File Explorer, and suddenly I decide that I would like to open Powershell as administrator at the current directory (the directory that I'm at in File ...
0 votes
1 answer
65 views

Autohotkey script doesn't work when VSCode focused

The default behavior for the shortcut <Windows Key + Number> is to open the respective application on your taskbar. I have this behavior overridden by the AHK script posted here, which changes ...
5 votes
4 answers
5k views

Beep or make a sound upon Cut, Copy, Paste

I have autohotkey installed in my windows 10. How can I have it "beep" or make a sound whenever I Cut, Copy or paste something. I'm working on a huge record which involves cutting-copying-...
0 votes
0 answers
31 views

AutoHotkey: switch Windows desktop in combination with full screen VNC

My problem is that the default shortcuts to change a Windows virtual desktop are not working when running a VNC client full screen. I need to pass all system shortcuts directly to the VNC session, ...
58 votes
4 answers
65k views

"Select to Copy and Middle Click to Paste" in Windows

Is there any application to mimic the "Select to Copy and Middle Click to Paste" behaviour in Windows? I was hoping to find an AutoHotkey script for this, but I couldn't. Maybe someone here could ...
0 votes
1 answer
4k views

How to disable view page source in Chrome?

I need one help from you that is to block the page of viewing the source (original sites should be opened but source page must be blocked). I have almost come to the solution with the help of ...
1 vote
2 answers
126 views

Alt + Shift + letter in AutoHotKey

In AutoHotKey, this works just fine RAlt & a::Send {U+00E4} ; RightAlt + a -> ä Now I want to map the capital version of that letter, i.e, RightAlt + RightShift + a -> Ä I tried this but ...
8 votes
3 answers
26k views

How to open a URL in a new browser window with AutoHotkey?

With AutoHotkey on Windows you can associate a shortcut to open a URL - web page or link - in the default browser with the following script: ^!g::Run https://mail.google.com/ This will open Gmail in ...
0 votes
0 answers
30 views

Why does the script work on a Notepad window, but not on an Explorer window and other program windows?

I found some code that works in the notepad, but can't work in the explorer and some other software, how to change it to universal?Or is there some other way, to scroll the number of lines without ...
4 votes
2 answers
4k views

How to make AutoHotkey automatically close a pop-up dialog?

Question I'd like AutoHotkey to automatically detect when a certain pop-up dialog appears and take certain actions. How do I do that? Concrete example In my particular case, I'd like AutoHotkey to ...
0 votes
1 answer
20 views

Supress #f in Visual Studio from opening "Feedback Hub"

I have the following autohotkey script: SetTitleMatchMode 2 #f:: if WinExist("Mozilla Firefox") WinActivate return #v:: if WinExist("Microsoft Visual Studio") ...
1 vote
2 answers
3k views

AutoHotKey remap page down to (ctrl + win + left)

How do I remap page down to (Ctrl+Win+left) for Windows 10 desktop switch. Same for page up to Ctrl+Win+right
1 vote
0 answers
31 views

Rewriting the input change logic "Alt" + "Shift" (release) on Windows?

I am trying to implement this algorithm, and rewrite Windows input change logic : I tried this LAlt:: While GetKeyState("LAlt", "P") { Input, key, L1, % "{LControl}{...
1 vote
1 answer
67 views

Suspend foreground process with AutoHotKey?

I have found how to suspend a specific process, and how to get the process path and name of the foreground window, but I'm not sure how to combine the two. I found this script and have been testing it ...
0 votes
0 answers
30 views

Modifier + Left Click to Middle Click

I would like to map a modifier key + left click to function as a middle click. For example, Ctrl + left click to middle click. I use a logitech mouse with the frictionless wheel that tilts left and ...
1 vote
1 answer
229 views

NirCmd volume control of certain applications from Volume Mixer not working?

So I use this app to mute microphone communication in Valorant. But I also want to mute the game itself. The devs of the game have separated these 2 so in Volume Mixer (SndVol.exe) they are 2 ...
0 votes
0 answers
25 views

I have an issue with dropdownlist and send command

I have a bot that monitors certain areas and captures pixels. I want a DropdownList to press a separate key on the keyboard for each captured pixel. It's a DropdownList where I can set which key to ...
0 votes
1 answer
69 views

Running a program before Windows login (Task Scheduler fails to execute)

I'd like to run a small *.exe written in AutoHotkey before the Windows user logon. I created a scheduled task for this, but it doesn't seem to work. In the task scheduler it reads "The last run ...
0 votes
0 answers
47 views

VLC Media Player: edit short jump forward based on total video time, not current position

I am looking to use VLC Media Player in a very specific way. I know I can edit jump sizes for very short jump, short jump, etc. Instead, I would like short jump to reflect the total video time, not ...
1 vote
1 answer
92 views

How do I auto highlight specified text in Autohotkey?

For example this replaces all the words test with test. :*?:test::test2 which works but I would like it to highlight that 'test2' given word.
1 vote
1 answer
73 views

Map Alt Space to Win (Start Menu) in Windows 10

I'm trying to map Alt+Space to open the Start Menu on Windows 10 (to the same hotkey as Spotlight on Mac). I'm trying to use AutoHotkey, but it's not working: LAlt & Space::LWin Maybe it has ...
1 vote
1 answer
237 views

Can use special characters without pressing shift key in windows10?

how can I use number keys in top of keyboard just for special characters like (@#$) without pressing shift key to use that. -for example when pressing num2 key just show @ I search about that just ...
1 vote
1 answer
2k views

Listen for screen off event and disable mouse in Windows

I want to prevent the mouse from waking my screens (while my PC is on but screens are off or the screensaver is on). I have read all the resources telling me exactly how "it can't be done", e.g. this ...
0 votes
1 answer
157 views

Make mouse wheel behave like arrow keys for camera movement in RTS game

I want my mouse wheel to work like the arrow keys on the keyboard, to move the camera in a game the same way I can do it with wheel left/right, which I could bind via the mouse software. But I could ...
0 votes
0 answers
64 views

What's wrong with my .bat file syntax?

I'm making a tiny batch file to do three things: Run an autohotkey file to remap certain keys. Immediately after, open a game executable, then wait until I close it in-game and... kill the autohotkey ...
0 votes
3 answers
1k views

How to map left shift to right shift?

My left shift fails to work on some keys (e.g. nzbkd8.;) sometimes, while right shift always works on all keys. Reinstalled all keyboard drivers (Uninstall -> Reboot), issue persists. Trying an AHK ...
0 votes
2 answers
81 views

Autohotkey - Sort ini file in reverse?

Is it possible to read an ini file in reverse? Can it be done with a "sort" or a "filereadline" loop? a.ini [section1] key1=1 [section2] key2=2 [section3] key3=3 [section4] key4=4 ...
0 votes
2 answers
97 views

Autohotkey - Keyboard Input to Only One Program

I'm trying to make it so that I can read and scroll through my Adobe Reader using the mouse, but when I start typing, I want it to go to my OneNote to take notes while I'm reading. I can set OneNote ...
13 votes
4 answers
6k views

Cannot get Windows snipping tool to auto run with AutoHotKey

I am trying to get Windows 7 sniping tool to run when I hit my PRINTSCREEN keyboard button with AUTOHOTKEY. I have been unsuccessful so far though. Here is what I have for the AutoHotKey script. ...

1
2 3 4 5
26