How should I write this alt+tab macro? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
emanate22
Posts: 52
Joined: 11 May 2021, 00:03

How should I write this alt+tab macro?

Post by emanate22 » 25 Jan 2022, 23:59

Start alt+tab if findtext does not find an image. This can only enter tab at present.

Code: Select all

$!Tab::
Text:="|<>*70$28. "
if (ok:=FindText(1879, 3, 1915, 41, 0, 0, Text))
{
}
else
{
sendinput {alt down}
sleep,1
sendinput {Tab}
sleep,1
sendinput {alt up}
}
return

Rohwedder
Posts: 7644
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How should I write this alt+tab macro?  Topic is solved

Post by Rohwedder » 26 Jan 2022, 02:50

Hallo,
try (not tested with FindText()):

Code: Select all

$!Tab::
Text:="|<>*70$28. "
if (ok:=FindText(1879, 3, 1915, 41, 0, 0, Text))
{
}
else
{
	KeyWait, Tab
	Send, {Alt down}{tab}
}
return

emanate22
Posts: 52
Joined: 11 May 2021, 00:03

Re: How should I write this alt+tab macro?

Post by emanate22 » 26 Jan 2022, 07:53

Rohwedder wrote:
26 Jan 2022, 02:50
Hallo,
try (not tested with FindText()):

Code: Select all

$!Tab::
Text:="|<>*70$28. "
if (ok:=FindText(1879, 3, 1915, 41, 0, 0, Text))
{
}
else
{
	KeyWait, Tab
	Send, {Alt down}{tab}
}
return
no need that keywait after test it

Code: Select all

$!Tab::
Text:="|<>*70$2"
if (ok:=FindText(1879, 3, 1915, 41, 0, 0, Text))
{
}
else
{
Send, {Alt down}{tab}
sleep,1
Send,{Alt up}
}
return

Post Reply

Return to “Ask for Help (v1)”