5 AutoHotkey scripts for Windows analysts: from project launch to window layout

Most analysts prepping for work on Windows follow the same script: open the project folder, launch the editor, open a terminal, switch to the browser for Jupyter. That's not analysis — it's a ritual that eats 5 minutes every single day. AutoHotkey is a free Windows tool that binds a hotkey to any piece of code. Five scripts solve this problem without touching the reproducibility pipeline. • Ctrl+Alt+W opens Explorer, VS Code, Windows Terminal, and Jupyter all at once • Ctrl+Alt+L converts a clipboard list into a Python list or a SQL IN (...) clause • Ctrl+Alt+P formats paths for Python (raw strings) or Ctrl+Alt+Shift+P (forward slashes)

AI-processed from KDnuggets; edited by Hamidun News
5 AutoHotkey scripts for Windows analysts: from project launch to window layout
Source: KDnuggets. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceKDnuggets ↗
Editor-in-Chief
Key metric #1Ctrl+Alt+W opens Explorer, VS Code, Windows Terminal, and Jupyter all at once
Key metric #2Ctrl+Alt+L converts a clipboard list into a Python list or a SQL IN (...) clause
Key metric #3Ctrl+Alt+P formats paths for Python (raw strings) or Ctrl+Alt+Shift+P (forward slashes)

Before starting analysis, most Windows analysts go through the same routine: open the project folder, launch VS Code, open Windows Terminal, switch to Jupyter at localhost:8888. Then a list of IDs needs converting into Python or SQL format, paths copied from Explorer come with backslashes (Python doesn't like those), and windows need rearranging. None of this is analysis — but together, it adds up to 5 minutes every day.

AutoHotkey v2.0 is a free Windows tool where a hotkey can trigger any piece of code. Five scripts solve this problem without touching the analysis reproducibility pipeline.

AutoHotkey is strictly a desktop tool

AutoHotkey is great for launching apps, converting clipboard contents, expanding abbreviations, and moving windows. It's the wrong tool for transformations that matter to the analysis itself — those belong in Python, R, or SQL, under version control, with tests. The clipboard holds IDs, tokens, query results: a script that reads it reads everything in there.

Script 1: Launch the workspace (Ctrl+Alt+W)

One hotkey opens Explorer with the project folder, VS Code in the working directory, Windows Terminal, and a browser pointed at localhost:8888. The apps launch as a single set, scoped to the project context. Switching to a different project means changing exactly one variable — the folder path.

Script 2:

Convert IDs into Python or SQL (Ctrl+Alt+L, Ctrl+Alt+Shift+L)

An ID column arrives from a spreadsheet. The notebook needs ['a', 'b', 'c'], SQL needs IN ('a', 'b', 'c'). Copy the column, press Ctrl+Alt+L for the Python format or Ctrl+Alt+Shift+L for SQL, and the ready-made list pastes instantly. This is the most useful of the five scripts.

The PasteList function splits the clipboard contents by line breaks, strips whitespace and carriage returns, wraps each value in single quotes, and joins them with commas. It doesn't escape quotes inside values — that's usually unnecessary for an ID column, and any more complex transformation belongs in the notebook instead.

Script 3: Hotstrings for imports and checklists

::;;imp:: expands into pandas, numpy, and matplotlib imports — three lines typed dozens of times a month. ::;;eda:: expands into an exploratory data analysis checklist (shape/dtypes, missing values, target balance, duplicates).

The ;; prefix prevents the expansion from triggering inside ordinary words. The * option fires the expansion right after the last character, with no space needed. SendText pastes the result literally, so brackets and special characters aren't misread as keystroke commands.

Script 4:

Convert paths for Python (Ctrl+Alt+P, Ctrl+Alt+Shift+P)

Copying a path from Explorer (right-click → "Copy as path") gives you "C:\Users\nd\data\raw.csv" with quotes included. Pasting that into Python throws an error: the backslashes get interpreted as the start of Unicode escape sequences.

Ctrl+Alt+P strips the quotes and wraps the path as a raw string: r'C:\Users\nd\data\raw.csv'. That stops the slashes from being interpreted.

Ctrl+Alt+Shift+P replaces the backslashes with forward slashes: C:/Users/nd/data/raw.csv. Windows accepts this format, and pathlib normalizes it back. Which format to use depends on project conventions: if the repo uses pathlib with forward slashes, that's the form you need.

Script 5: Window layout (Ctrl+Alt+1)

One hotkey snaps three windows back into position: Windows Terminal at the bottom (0, 720, 1280, 720), JupyterLab top-left (0, 0, 1280, 720), VS Code on the right (1280, 0, 1280, 1440). Pixel coordinates are stored in variables at the top of the file, so they're easy to adjust when the monitor setup changes.

Caveats: on systems with monitors running different DPI settings, the final position can differ from the requested one. Negative coordinates address the monitor to the left. A window running with admin rights ignores the script unless it's also run elevated. Layout is machine configuration — it gets tidied up every time the screen setup changes.

How to apply this: the boundary doesn't move

All five scripts fit into a single .ahk file that a colleague can read in a minute. Start with the script that saves the most time — for most analysts, that's the clipboard ID converter. Add the rest as the rituals they eliminate become noticeable. The boundary described above doesn't shift: AutoHotkey is glue around the analysis, while every transformation and join still lives under version control in Python, R, or SQL. When the workflow changes, delete the script and write the next one.

Key Questions Answered

What are the key details on AutoHotkey is strictly a desktop tool?

AutoHotkey is great for launching apps, converting clipboard contents, expanding abbreviations, and moving windows. It's the wrong tool for transformations that matter to the analysis itself — those belong in Python, R, or SQL, under version control, with tests. The clipboard holds IDs, tokens, query results: a script that reads it reads everything in there.

What are the key details on Script 1: Launch the workspace (Ctrl+Alt+W)?

One hotkey opens Explorer with the project folder, VS Code in the working directory, Windows Terminal, and a browser pointed at localhost:8888. The apps launch as a single set, scoped to the project context. Switching to a different project means changing exactly one variable — the folder path.

What are the key details on Script 2: Convert IDs into Python or SQL (Ctrl+Alt+L, Ctrl+Alt+Shift+L)?

An ID column arrives from a spreadsheet. The notebook needs ['a', 'b', 'c'], SQL needs IN ('a', 'b', 'c'). Copy the column, press Ctrl+Alt+L for the Python format or Ctrl+Alt+Shift+L for SQL, and the ready-made list pastes instantly. This is the most useful of the five scripts. The PasteList function splits the clipboard contents by line breaks, strips whitespace and carriage returns, wraps each value in single quotes, and joins them with commas. It doesn't escape quotes inside values — that's usually unnecessary for an ID column, and any more complex transformation belongs

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…