[V2 Wish] WinGetTitle sets LastFoundWindow

Propose new features and changes
User avatar
DuckingQuack
Posts: 219
Joined: 20 Jan 2023, 18:20

[V2 Wish] WinGetTitle sets LastFoundWindow

Post by DuckingQuack » 29 Jan 2023, 22:07

If possible, I'd like to see WinGetTitle gain the capacity to set the LastFoundWindow.

Now, I'm certain several people will have a great explanation as to why this is a terrible thing to implement.
However, with my limited experience, this is something that would make writing scripts around titles easier and require fewer lines. (I'm looking at you WinExist("A"). :problem: )

I searched for a thread that might have already discussed this and came up null. If this is a duplicate or something that has already been addressed, please remove this thread.

Thanks for coming to my TED Talk.

User avatar
lmstearn
Posts: 694
Joined: 11 Aug 2016, 02:32
Contact:

Re: [V2 Wish] WinGetTitle sets LastFoundWindow

Post by lmstearn » 30 Jan 2023, 08:43

To set the Last Found Window is a lovely wish, and lo and behold, it has already been granted with WinSetTitle(), and to make it uber-easy, the Last Found Window is default whenever NewTitle is the only parameter used. (To get the Last Found Window, just use WinGetTitle() ). :)
:arrow: itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH

User avatar
DuckingQuack
Posts: 219
Joined: 20 Jan 2023, 18:20

Re: [V2 Wish] WinGetTitle sets LastFoundWindow

Post by DuckingQuack » 30 Jan 2023, 10:06

@lmstearn WinGetTitle does not set LastWindowFound.
Please reference the LastWindowFound section for a list of functions that do set the LastWindowFound:
https://www.autohotkey.com/docs/v2/misc/WinTitle.htm
Best of Luck,
The Duck

User avatar
DuckingQuack
Posts: 219
Joined: 20 Jan 2023, 18:20

Re: [V2 Wish] WinGetTitle sets LastFoundWindow

Post by DuckingQuack » 30 Jan 2023, 10:12

In case clarification is required, it seems extremely redundant to use winexist(a) before wingettitle(a) just to be able to use the next function that requires a lastfoundwindow.
Best of Luck,
The Duck

just me
Posts: 9453
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [V2 Wish] WinGetTitle sets LastFoundWindow

Post by just me » 30 Jan 2023, 10:31

Code: Select all

Title := WinGetTitle(WinExist("A")) ; get the title of the actice window and set the last found window
;)

iseahound
Posts: 1444
Joined: 13 Aug 2016, 21:04
Contact:

Re: [V2 Wish] WinGetTitle sets LastFoundWindow

Post by iseahound » 30 Jan 2023, 10:33

@just me Was going to paste the same thing!

Also LastFoundWindow is a hidden variable which took me many months to realize it was even there.

User avatar
DuckingQuack
Posts: 219
Joined: 20 Jan 2023, 18:20

Re: [V2 Wish] WinGetTitle sets LastFoundWindow

Post by DuckingQuack » 30 Jan 2023, 10:40

@just me
Very nice, thank you.
Still somewhat redundant, but better than a bunch of extra lines of winexist(a)!
Thanks! I guess delete this thread?
Best of Luck,
The Duck

Post Reply

Return to “Wish List”