Skip to content

Commit

Permalink
add excludeTitle parameter to tryGetID and tryActivate
Browse files Browse the repository at this point in the history
modify arc shortcut to not focus picture in picture
  • Loading branch information
TheCrether committed Aug 30, 2024
1 parent 5c9c430 commit e5bcf4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Lib/Base.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ OutputWindow(hwnd) {
OutputDebug(text . "`n====`n")
}

tryGetID(title, regex := false, detectHidden := false) {
tryGetID(title, regex := false, detectHidden := false, excludeTitle := "") {
beforeMatchMode := A_TitleMatchMode
beforeHidden := A_DetectHiddenWindows
if regex {
Expand All @@ -213,7 +213,7 @@ tryGetID(title, regex := false, detectHidden := false) {

id := ""
try {
id := WinGetID(title)
id := WinGetID(title, , excludeTitle)
}

SetTitleMatchMode(beforeMatchMode)
Expand All @@ -222,14 +222,14 @@ tryGetID(title, regex := false, detectHidden := false) {
return id
}

tryActivate(title, regex := false, detectHidden := false) {
tryActivate(title, regex := false, detectHidden := false, excludeTitle := "") {
beforeHidden := A_DetectHiddenWindows
if detectHidden {
DetectHiddenWindows(true)
}

try {
WinActivate(tryGetID(title, regex, detectHidden))
WinActivate(tryGetID(title, regex, detectHidden, excludeTitle))
} catch {
OutputDebug(Format("(regex:{1})(detectHidden:{2}) can't find window with: {3}`n", regex, detectHidden, title))
}
Expand Down
2 changes: 1 addition & 1 deletion i3help.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SetIcon(".\icons\i3help.ico")

#a:: tryActivate(".* - Discord ahk_class Chrome_WidgetWin_1 ahk_exe Discord.exe", true, true)
#s:: tryActivate("ahk_class Chrome_WidgetWin_1 ahk_exe Spotify.exe", false, true)
#b:: tryActivate("Arc ahk_exe Arc.exe", false, true)
#b:: tryActivate("Arc ahk_exe Arc.exe", true, true, "picture in picture")
#o:: tryActivate(".* - Obsidian .* ahk_exe Obsidian.exe", true, true)

PrintScreen:: Send("#+s")
Expand Down

0 comments on commit e5bcf4d

Please sign in to comment.