^u:: { ; ——————— 1) Hotkey hit ——————— MsgBox("DEBUG: 1) Hotkey triggered") ; ——————— 2) Ensure base folder ——————— baseFolder := "E:\" ; ← **CHANGE THIS** to YOUR real path DirCreate(baseFolder) ; will create it (and parents) if needed if !FileExist(baseFolder) { MsgBox("DEBUG: 2) FAILED to create baseFolder: " . baseFolder) return } MsgBox("DEBUG: 2) baseFolder exists: " . baseFolder) ; ——————— 3) Get active window & process ——————— winID := WinActive("A") if !winID { MsgBox("DEBUG: 3) No active window") return } MsgBox("DEBUG: 3) winID = " . winID) procName := WinGetProcessName(winID) MsgBox("DEBUG: 3) procName = " . procName) ; ——————— 4) Browser whitelist ——————— allowed := Map( "chrome.exe", true, "firefox.exe", true, "msedge.exe", true, "brave.exe", true, "opera.exe", true ) if !allowed.Has(procName) { MsgBox("DEBUG: 4) Not a whitelisted browser: " . procName) return } MsgBox("DEBUG: 4) Browser allowed") ; ——————— 5) Grab & clean title ——————— title := WinGetTitle(winID) if !IsSet(title) || Trim(title) = "" { MsgBox("DEBUG: 5) No title found") return } MsgBox("DEBUG: 5) Raw title = " . title) cleanTitle := RegExReplace(title, '[/\\:*?"<>|]', "") if Trim(cleanTitle) = "" { MsgBox("DEBUG: 5) Title empty after cleaning") return } MsgBox("DEBUG: 5) cleanTitle = " . cleanTitle) ; ——————— 6) Build path & create folder ——————— targetPath := baseFolder . "\" . cleanTitle MsgBox("DEBUG: 6) targetPath = " . targetPath) DirCreate(targetPath) if !FileExist(targetPath) { MsgBox("DEBUG: 6) FAILED to create targetPath") return } MsgBox("DEBUG: 6) Folder created") ; ——————— 7) Done ——————— TrayTip("Folder Created", cleanTitle, 3) }