#Persistent #SingleInstance force F1:: ;Launch both Dopus & Eveverything if they are not active, then switch between them instantly. TogglePrograms() return TogglePrograms() { IfWinNotExist, ahk_exe everything64.exe ; Check if Everything is not already running { Run, "C:\Program Files\Everything 1.5a\Everything64.exe" ; Launch Everything if it's not running } IfWinNotExist, ahk_exe dopus.exe ; Check if Directory Opus is not already running { Run, "C:\Program Files\GPSoftware\Directory Opus\dopus.exe" ; Launch Directory Opus if it's not running } IfWinExist, ahk_exe dopus.exe { IfWinActive, ahk_exe dopus.exe { WinActivate, ahk_exe everything64.exe WinWait, ahk_exe Everything64.exe Sleep 200 ControlSend, , ^{L} ; This line bring your curser to the search field automatically if it's not already there. } else { WinActivate, ahk_exe dopus.exe } } else { WinActivate, ahk_exe everything64.exe WinWait, ahk_exe Everything64.exe Sleep 200 ControlSend, , ^{L} ; This line bring your curser to the search field automatically if it's not already there. } } ;In this script: ;If Everything (everything64.exe) is not already running, it will be launched. ;If Directory Opus (dopus.exe) is not already running, it will be launched. ;After ensuring both programs are running, the script toggles between them as before. ;Adjust the paths "C:\Path\To\everything64.exe" and "C:\Path\To\dopus.exe" to the actual paths where Everything and Directory Opus executables are located. ;Now, pressing F1 will toggle between Everything and Directory Opus, launching them if they are not already running.