Can I suspend a script by running a specific command using Windows' Run command dialog box?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
supplementfacts
Posts: 44
Joined: 15 Jul 2018, 16:29

Can I suspend a script by running a specific command using Windows' Run command dialog box?

06 Aug 2023, 16:13

I have a script at c:\scripts\script.ahk. If I execute the command "c:\scripts\script.ahk" using Windows' Run command dialog box, it loads the script or reloads it if it's already running. Is there a command I could execute to suspend the script? Maybe something like "c:\scripts\script.ahk -s" (I'm just making up something halfway plausible)?

Thanks.
Master_X
Posts: 33
Joined: 04 Aug 2023, 13:59

Re: Can I suspend a script by running a specific command using Windows' Run command dialog box?

06 Aug 2023, 17:23

I don't see any command line parameters working if you use the script to start. It has at least to be an executable file. But maybe tell me a little more what you want to archieve

Also I just looked for suspend in ahk documentation. You can use something like this to toggle suspend or has it to be the run dialog?

Code: Select all

^!s::Suspend  ; STRG+ALT+S
supplementfacts
Posts: 44
Joined: 15 Jul 2018, 16:29

Re: Can I suspend a script by running a specific command using Windows' Run command dialog box?

06 Aug 2023, 18:33

Is there any way I can convert the AHK file into an EXE, load it using the Run command dialog box, and then suspend it using the Run command dialog box?
Master_X
Posts: 33
Joined: 04 Aug 2023, 13:59

Re: Can I suspend a script by running a specific command using Windows' Run command dialog box?

06 Aug 2023, 18:59

I was wrong. Parameters work without the .exe. But if you installed ahk from main site you get a compile(gui) option in your right click menu. Very handy.

Here's what you kinda need. But it won't use the current script it will close the old one and start again with suspend on if you add -s.

Code: Select all

#SingleInstance, Force
If (A_Args.Length() > 0) {
    ; Erster Kommandozeilenparameter
    Parameter1 := A_Args[1]
    
    ; Verarbeiten Sie den ersten Parameter
    If (Parameter1 = "-s") {
        Suspend on
	}	
	}
supplementfacts
Posts: 44
Joined: 15 Jul 2018, 16:29

Re: Can I suspend a script by running a specific command using Windows' Run command dialog box?

06 Aug 2023, 19:03

Thanks, but I'm confused. How can I execute this using Windows' Run command dialog box?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Rohwedder, Rxbie, tabr3 and 154 guests