I want to make a script something like this:
Run c:.\hello.ahk
If winexist hello.ahk
Run c:\goodbye.ahk
I understand that i somehow need to use showhiddenwindow and settitlematchmode.
Check if script is running
Re: Check if script is running
Try this:
I hope that helps.
Code: Select all
F11:: Run, c:.\hello.ahk
F12::
SetTitleMatchMode, 2
DetectHiddenWindows, On
If WinExist("hello.ahk" . " ahk_class AutoHotkey")
Run, c:\goodbye.ahk
Return
Re: Check if script is running
Nothing happens :/
Re: Check if script is running
Please check your system tray for the number of AHK icons. Also consider to post an example for hello.ahk and an example for goodbye.ahk.
I have made up my own examples and it works.
Another way to go from here is you explain what you expect to happen. A statement like yours is not enough information.
I have made up my own examples and it works.
Another way to go from here is you explain what you expect to happen. A statement like yours is not enough information.
Re: Check if script is running
There's a reason why I always leave a comment like ...wolf_II wrote:Please check your system tray for the number of AHK icons. Also consider to post an example for hello.ahk and an example for goodbye.ahk.
I have made up my own examples and it works.
Code: Select all
F12:: ; press F12 to start the script
Re: Check if script is running
Code: Select all
#a::
SetTitleMatchMode, 2
DetectHiddenWindows, On
ide := WinExist("Asistente") ;ide=ID in Spanish
if (ide=="0xe0632") or (ide=="0x0"){
Run, D:\Programas\Scripts\AHK\Asistente\Asistente.ahk
MsgBox, Se abrió el asistente ;Opening assistant
}
else
{
MsgBox, El asistente ya está abierto ;Already open
}
;0xe0632/0x0 ← es lo que devuelve WinExist("Asistente") cuando no está abierto
;Those values are the ones that WinExist("Asistente") returns when "the assistant" is not open
Return
Who is online
Users browsing this forum: Bing [Bot], bobstoner289 and 207 guests