Page 1 of 1

"script 1" and "script 2"

Posted: 30 Jun 2020, 00:28
by Clemens375
Hello,

When I have 2 scripts running "script 1" and "script 2" and both scripts have the command:

:T:00::

How can I make always the command only work on "script 2" when both are running. When only "script 1" is runnig it also works there.

Thank you!

Re: "script 1" and "script 2"

Posted: 30 Jun 2020, 06:03
by boiler

Code: Select all

SetTitleMatchMode, 2

#If !WinExist("script 2.ahk")
:T:00::This is script 1

Code: Select all

:T:00::This is script 2

Re: "script 1" and "script 2"

Posted: 30 Jun 2020, 08:58
by Rohwedder
Hallo @boiler,
DetectHiddenWindows is needed:

Code: Select all

SetTitleMatchMode, 2
DetectHiddenWindows, On

#If !WinExist("script 2.ahk")
:T:00::This is script 1

Re: "script 1" and "script 2"

Posted: 30 Jun 2020, 09:16
by boiler
Yes, thanks.

Re: "script 1" and "script 2"

Posted: 01 Jul 2020, 01:57
by Clemens375
@Rohwedder
@boiler

Thank you for the replys!

What have i exactly to write?
This are my script names/locations:

D:\0 BALDI VS GRANNY\2.ahk
D:\0 BALDI VS GRANNY\1000 Scripte\Y X CLICK.ahk

I want when 2.ahk is running always the command from 2.ahk is only working.

Thank you!

Re: "script 1" and "script 2"

Posted: 01 Jul 2020, 04:49
by boiler
Y X CLICK.ahk:

Code: Select all

SetTitleMatchMode, 2
DetectHiddenWindows, On

#If !WinExist("2.ahk")
:T:00::This is script 1
2.ahk:

Code: Select all

:T:00::This is script 2