Wizardry Posted August 7, 2020 Share Posted August 7, 2020 I have a script which is compiled and runs at start up. Its function is to stop all running scripts by pressing a hotkey. I obtained this script from this forums as it was authored by someone else. It works great but I wanted to add one more feature to it. I wanted to have it close all the running scripts and then open my hotkeys. So I added the function named: OpenHotkeys to the existing script. When I invoke the hotkey ("Ctrl - Alt - Shift + Pause) to stop all running scripts, all running scripts are stopped but the set of hotkeys I want to run does not execute. Any help would be appreciated. Thanks in advanceAutoIt - Kill-Stop all Scripts - JQ Modified.au3 Link to comment Share on other sites More sharing options...
argumentum Posted August 7, 2020 Share Posted August 7, 2020 ..take a look at: Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Wizardry Posted August 8, 2020 Author Share Posted August 8, 2020 Argumentum, How does your viewer help solve the issue I posted? I see no correlation. Link to comment Share on other sites More sharing options...
TheXman Posted August 8, 2020 Share Posted August 8, 2020 (edited) Quote Func HotKeyPressed() Local $i = 0 ToolTip("ProcessClose: AutoIt3 # " & $i, 50, 50, "Emergency close !", 1) Do While ProcessExists("Autoit3.exe") $i += 1 ToolTip("ProcessClose: AutoIt3.exe # " & $i, 50, 50, "Emergency close !", 1) ProcessClose("AutoIt3.exe") WEnd While ProcessExists("AutoIt3_x64.exe") $i += 1 ToolTip("ProcessClose: AutoIt3_x64.exe # " & $i, 50, 50, "Emergency close !", 1) ProcessClose("AutoIt3_x64.exe") WEnd Sleep(2000) Until (Not ProcessExists("AutoIt3.exe") And Not ProcessExists("AutoIt3_x64.exe")) ToolTip("") Return $i Sleep(5000) Call("f_OpenHotkeys") Msgbox(0, "Open Hot Keys", "Opening Hotkeys") EndFunc ;==>HotKeyPressed 23 hours ago, Wizardry said: When I invoke the hotkey ("Ctrl - Alt - Shift + Pause) to stop all running scripts, all running scripts are stopped but the set of hotkeys I want to run does not execute. Any help would be appreciated. In your HotKeyPressed() function, how do you think the code after the "Return" statement is going to get executed? Also, Call("f_OpenHotkeys") is the exact same as f_OpenHotkeys(). You don't need to use the Call function to execute that function. Edited August 8, 2020 by TheXman Danp2 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Wizardry Posted August 9, 2020 Author Share Posted August 9, 2020 Thanks for the help. I have it figured out. "Return" ends a function. The Shellexecute command does the trick to run the script I need. Link to comment Share on other sites More sharing options...
argumentum Posted August 9, 2020 Share Posted August 9, 2020 9 hours ago, Wizardry said: How does your viewer help solve the issue I posted? I see no correlation. lol 32 minutes ago, Wizardry said: I have it figured out. "Return" ends a function. You've got it 33 minutes ago, Wizardry said: The Shellexecute command does the trick to run the script I need. There is no trick, just coding. The reason I pointed to that code, is because you question was no clear to me and I figure that you may get a hint on how to code your script out of that other script. Happy coding Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now