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

The popular SciTE-based AutoHotkey Script Editor
zeta2400
Posts: 7
Joined: 05 Jun 2017, 16:19

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

30 Jun 2017, 13:12

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.
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

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

01 Jul 2017, 10:54

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?
try it and see
...
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

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

30 Dec 2017, 02:35

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)
aprendizbr
Posts: 2
Joined: 06 Jul 2019, 11:05

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

15 Apr 2020, 19:23

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.

Return to “SciTE4AutoHotkey”

Who is online

Users browsing this forum: No registered users and 18 guests