I'm need help with short script.
when specific web page that starts with "www.notion.so" is open in foreground, activate hotkeys.
something like:
Code: Select all
#ifWinActive notion
!a::
MsgBox, Notion is opened
Return
#ifWinActive
Code: Select all
#ifWinActive notion
!a::
MsgBox, Notion is opened
Return
#ifWinActive
Code: Select all
SetTitleMatchMode 2 ; 2: A window's title can contain WinTitle anywhere inside it to be a match.
#IfWinActive notion ; if 'Notion' in the title
!a::
msgbox Notion is Active
return
Code: Select all
#IfWinActive, ahk_exe chrome.exe
#if WinActive("YouTube")
!a::
msgbox YouTube is Active
return
#ifWinActive
#ifWinActive Facebook
!a::
msgbox Facebook is Active
return
#ifWinActive
#if WinActive("Google") AND !WinActive("YouTube") AND !WinActive("Facebook")
!a::
msgbox Google is Active
return
#ifWinActive
#IfWinActive
Code: Select all
SetTitleMatchMode 2 ; 2: A window's title can contain WinTitle anywhere inside it to be a match.
#IfWinActive YouTube ; if 'Notion' in the title
!a::
msgbox YouTube is Active
return
Code: Select all
SetTitleMatchMode 2 ; 2: A window's title can contain WinTitle anywhere inside it to be a match.
!a::
If WinActive("Notion") ; if 'Notion' in the title
msgbox Notion is Active
return
Code: Select all
#IfWinActive Notion
!h::
msgbox Notion is Active
return
Code: Select all
; keyword list, warning: Case Sensitive
Keyword := "YouTube,Notion,Instagram"
!a::
WinGetTitle, Title, A ;Get Window Title
loop, Parse, Keyword, `, ;Keyword slicing
{
while inStr(Title, A_LoopField) { ;while keyword in title
switch A_LoopField { ;which keyword
case "Notion":
msgbox Notion
case "YouTube":
msgbox YouTube
case "Instagram":
msgbox ins
return
}
return
}
}
return
Users browsing this forum: Rohwedder and 176 guests