Skip to content

How do I cycle between multiple windows with the same ahk_exe title? #323

Answered by trajano
trajano asked this question in Q&A
Discussion options

You must be logged in to vote

I took your idea but I found out the hard way that ahk_exe WindowsTerminal.exe only returns one window even if I detach the tabs

windows_terminal_title = "ahk_exe WindowsTerminal.exe"
terminal_windows : list[Window] = ahk.find_windows(title=windows_terminal_title)
last_active_terminal_window : Window|None = None
def windows_terminal() -> None:
    global terminal_windows
    global last_active_terminal_window
    next_terminal_windows = ahk.find_windows(title=windows_terminal_title)
    # remove terminal windows that are not in next
    terminal_windows = list(filter(lambda it: it in next_terminal_windows, terminal_windows))
    if not terminal_windows:
        exe_path = shutil.which("wt…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@trajano
Comment options

Answer selected by spyoungtech
@spyoungtech
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants