I'm going to post my whole AHK file in case there's something wrong with the code before or after it? Or could it be that there's spaces in the file name? Is there a way around that? I could remove the spaces in the program folder, but I think that may break the program itself right? I censored the username of my computer below, the XXXXXX isn't the problem.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CapsLock::SetCapsLockState, % A_PriorHotkey = "CapsLock" && A_TimeSincePriorHotkey < 500 ? "On" : "Off"
Return
CapsLock & c::
IfWinExist ahk_exe chrome.exe
winactivate ahk_exe chrome.exe
else
run, "C:\Program Files\Google\Chrome\Application\chrome.exe"
WinWait ahk_exe chrome.exe
WinActivate ahk_exe chrome.exe
WinWaitActive ahk_exe chrome.exe
Return
CapsLock & t::
IfWinExist ahk_exe todoist.exe
winactivate ahk_exe todoist.exe
else
run, "C:\Users\XXXXXX\AppData\Local\Programs\todoist\Todoist.exe"
WinWait ahk_exe todoist.exe
WinActivate ahk_exe todoist.exe
WinWaitActive ahk_exe todoist.exe
Return
CapsLock & v::
IfWinExist ahk_exe Visual Studio Code.exe
winactivate ahk_exe Visual Studio Code.exe
else
run, "C:\Users\XXXXXX\AppData\Local\Programs\Microsoft VS Code\Code.exe"
WinWait ahk_exe Visual Studio Code.exe
WinActivate ahk_exe Visual Studio Code.exe
WinWaitActive ahk_exe Visual Studio Code.exe
Return
CapsLock & s::
IfWinExist ahk_exe spotify.exe
winactivate ahk_exe spotify.exe
else
run, "C:\Users\XXXXXX\AppData\Roaming\Spotify\Spotify.exe"
WinWait ahk_exe spotify.exe
WinActivate ahk_exe spotify.exe
WinWaitActive ahk_exe spotify.exe
Return
CapsLock & j::
IfWinExist ahk_exe chrome.exe
winactivate ahk_exe chrome.exe
else
run, "C:\Program Files\Google\Chrome\Application\chrome.exe"
WinWait ahk_exe chrome.exe
WinActivate ahk_exe chrome.exe
WinWaitActive ahk_exe chrome.exe
Send ^t
Sleep 50
SendInput http://localhost:8096/web/index.html{Enter}
Return