I asked previously a question in this topic viewtopic.php?f=76&t=110906 and thanks for mikeyww he answered my question, but today I want to ask similar question but with more details, how to use #If or #IfWinActive with programs, websites, and Program Manager for the case that I'm in the desktop, so I tried to create a script that show MsgBox If one of the following programs or websites is activated:
1. Word
2. Excel
3. https://drive.google.com/
4. https://www.autohotkey.com/
5. Program Manager
For this, it could be the first line of the script is somehow long, but here is in the following what I tried:
Code: Select all
#If WinActive("ahk_exe WINWORD.exe") || WinActive("ahk_exe EXCEL.exe") || WinActive("https://drive.google.com/") || WinActive ("https://www.autohotkey.com/") || WinActive Program Manager
F4::
MsgBox, Hello
Return
#IfWinActive