Storing WinTitle into Multiple Variable and WinActivate one of the title using the Stored Variables

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Ram
Posts: 16
Joined: 13 Jan 2021, 10:56

Storing WinTitle into Multiple Variable and WinActivate one of the title using the Stored Variables

Post by Ram » 05 Apr 2021, 04:52

hello, i need some help.

So i want to get WINTITLE from multiple excel windows and store them into multiple variables, then activate the preferred window using WINACTIVATE WINTITLE whenever i want. It would likely be like this :

(when 1st Excel file is open ) :
WinGetTitle, 1st, A ;storing 1st title to "1st" variable

;when 2nd Excel file is open
WinGetTitle, 2nd, A ;storing 2nd title to "2nd" variable

;when 3rd Excel ifle is open
Win GetTItle, 3rd, A ; storing 3nd title to "2nd" variable

(when i want to activate 1 of the window)
WinActivate, 1st or 2nd or 3rd ; activate 1 of the title

But the problem is, i only able to activate the 1st window.

So what should i do? can somebody help me with this please? Thankyou very much
Rohwedder
Posts: 7770
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Storing WinTitle into Multiple Variable and WinActivate one of the title using the Stored Variables

Post by Rohwedder » 05 Apr 2021, 05:07

Hallo,
perhaps:

Code: Select all

a::A := WinExist("A") ;store
+a::WinActivate, ahk_id %A% ;activate
b::B := WinExist("A")
+b::WinActivate, ahk_id %B%
Post Reply

Return to “Ask for Help (v1)”