Code: Select all
!z::ExitApp
Code: Select all
!z::ExitApp
Code: Select all
#Requires AutoHotkey v2.0
!z:: { ; ALT-Z = Close another script, and exit
otherScript := A_ScriptDir '\r.ahk'
DetectHiddenWindows True
Try WinClose otherScript ' ahk_class AutoHotkey'
SoundBeep(1500), ExitApp()
}
Hello, thanks for the help! But I faced the errormikeyww wrote: ↑18 Mar 2023, 10:04Hello,
Having two scripts with the same hotkey, running at the same time, is a bad idea. It is also not necessary for your goal, because you can simply use WinClose to close another window.
Learn about modifier keys
Code: Select all
#Requires AutoHotkey v2.0 !z:: { ; ALT-Z = Close another script, and exit otherScript := A_ScriptDir '\r.ahk' DetectHiddenWindows True Try WinClose otherScript ' ahk_class AutoHotkey' SoundBeep(1500), ExitApp() }
Code: Select all
Parameter #1 invalid
Code: Select all
DetectHiddenWindows True
Oh I thought I had v2. And now I see version 2 is realesed lately! I have some connection issues with my PC (I live in Iran ). I will inform you the result when I do the process. Thanks again! Bye for now.mikeyww wrote: ↑18 Mar 2023, 10:26Run my script by itself first, with no other code, and no changes. It assumes that you are using AHK v2. Use the last version that I posted (above). Use copy and paste to paste the text into your script file. If it fails, then post your exact script in a new reply below, and include a screenshot of the error message.
Code: Select all
#Requires AutoHotkey v1.1.33
!z:: ; ALT-Z = Close another script, and exit
otherScript := A_ScriptDir "\r.ahk"
DetectHiddenWindows On
WinClose % otherScript " ahk_class AutoHotkey"
SoundBeep 1500
ExitApp
Thanks a lot sir! It was my mistake. Also glad to see there is a v2 of AHK.mikeyww wrote: ↑18 Mar 2023, 10:53You are posting in the v2 forum.
V1 is below.
Code: Select all
#Requires AutoHotkey v1.1.33 !z:: ; ALT-Z = Close another script, and exit otherScript := A_ScriptDir "\r.ahk" DetectHiddenWindows On WinClose % otherScript " ahk_class AutoHotkey" SoundBeep 1500 ExitApp