Page 1 of 1

Bug Report: F5 hotkey for Reload not working (sometimes)

Posted: 30 Jun 2017, 13:12
by zeta2400
Hi

In SciTE4AutoHotkey, I added the following line to my script:

Code: Select all

#SingleInstance Force  ; When reloading the script, skips the dialog box and replaces the old instance automatically, which is similar in effect to the Reload command.
As a result, when I click the Run script button or press the F5 hotkey in SciTE4AutoHotkey, the old instance of my script is replaced with a new instance without prompting me. Nice.

The problem: While clicking on the Run script button always does the job, pressing the F5 hotkey only sometimes works. In other words, pressing the F5 hotkey doesn't reload the script about 40% of the time.
It is worth mentioning that this problem only occurs when the

Code: Select all

#SingleInstance Force
directive is added to the script. When not, pressing the F5 hotkey always works (prompts me if I want to have the new instance replace the old one).

Any comments?
Thanks.

Re: Bug Report: F5 hotkey for Reload not working (sometimes)

Posted: 01 Jul 2017, 10:54
by derz00
Hey I've had the same problem. I use force SingleInstance, but didn't know if this was a global bug, or a problem with my computer. Does anyone know why it does this?

Re: Bug Report: F5 hotkey for Reload not working (sometimes)

Posted: 30 Dec 2017, 02:35
by lexikos
That's no bug, just a big limitation. SciTE can only run one thing (on the subsystem that allows catching output) at a time. You can't even do a find-in-files while running a script.

You can use Ctrl+Shift+F5 instead, or you can add this line to your SciTE user properties:

Code: Select all

command.go.subsystem.$(file.patterns.ahk)=2
If you add /R or /restart to the command line SciTE uses to launch scripts, new instances of the script will terminate an old instance even without #SingleInstance Force (or even with #SingleInstance Off).

Code: Select all

command.go.$(file.patterns.ahk)="$(AutoHotkey)" /ErrorStdOut /R "$(FilePath)" $(1) $(2) $(3) $(4)

Re: Bug Report: F5 hotkey for Reload not working (sometimes)

Posted: 15 Apr 2020, 19:23
by aprendizbr
zeta2400 wrote:
30 Jun 2017, 13:12

(...)
Any comments?
Thanks.

Add the following to the Autorun.ahk:

Code: Select all


#IfWinActive ahk_class SciTEWindow
f5::
MouseClick, Left, 392, 58
Return
Obs.:
Autorun.ahk should probably be in C:\Users\"User"\Documents\AutoHotkey\SciTE\Autorun.ahk

Excuse bad English.