Jump to content

Open hotkeys after stopping all autoit scripts


Recommended Posts

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

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:huh2:;)

 

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 by TheXman
Link to comment
Share on other sites

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   :construction:

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...