AHK can't recognize paths with space properly. Run("C:\Users\..\code.exe" "C:\Users\hello world.ahk) will open two files
Posted: 27 Apr 2024, 05:37
it will open two files in VSCODE: "hello" and "world.ahk"
what I want is:
this only works fine with files with not spaces.
Code: Select all
#Requires AutoHotkey v2.0
f1:: {
Run("C:\Users\jethr\AppData\Local\Programs\Microsoft VS Code\Code.exe " "C:\Users\jethr\OneDrive\Desktop\hello world.ahk")
}
Code: Select all
f1:: {
Send("^c") ; copy the file path
sleep(100)
Run("C:\Users\jethr\AppData\Local\Programs\Microsoft VS Code\Code.exe " A_Clipboard)
return
}