"script 1" and "script 2"

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
John1
Posts: 236
Joined: 11 May 2020, 11:54

"script 1" and "script 2"

30 Jun 2020, 00:28

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!
User avatar
boiler
Posts: 16986
Joined: 21 Dec 2014, 02:44

Re: "script 1" and "script 2"

30 Jun 2020, 06:03

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
Rohwedder
Posts: 7656
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: "script 1" and "script 2"

30 Jun 2020, 08:58

Hallo @boiler,
DetectHiddenWindows is needed:

Code: Select all

SetTitleMatchMode, 2
DetectHiddenWindows, On

#If !WinExist("script 2.ahk")
:T:00::This is script 1
John1
Posts: 236
Joined: 11 May 2020, 11:54

Re: "script 1" and "script 2"

01 Jul 2020, 01:57

@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!
User avatar
boiler
Posts: 16986
Joined: 21 Dec 2014, 02:44

Re: "script 1" and "script 2"

01 Jul 2020, 04:49

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

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 74 guests