SciTE4AutoHotkey v3.1 portable: run .ah2/.ahk extension with v2/v1 ?

The popular SciTE-based AutoHotkey Script Editor
neogna2
Posts: 600
Joined: 15 Sep 2016, 15:44

SciTE4AutoHotkey v3.1 portable: run .ah2/.ahk extension with v2/v1 ?

Post by neogna2 » 28 Oct 2022, 04:44

How do we configure SciTE4AutoHotkey v3.1 portable to run .ah2/.ahk files with the v2/v1 executable based on file extension alone (not #Requires lines)?

I have edited SciTEUser.properties like @FanaticGuru suggested in this post :

Code: Select all

file.patterns.ahk=*.ahk;*.ah2
file.patterns.ahk1=*.ahk
file.patterns.ahk2=*.ah2
ah2.file.extension=*.ah2
filter.ahk=\
AutoHotkey scripts (*.ahk)|$(ahk.file.extension)|\
AutoHotkey v2 scripts (*.ah2)|$(ah2.file.extension)|\
AHK scriptlets (*.scriptlet)|$(ahkscriptlet.file.extension)|
and placed a copy of the v2 executable at this relative path to S4A
C:\example\SciTe\
C:\example\v2\AutoHotkey64.exe


But when I press F5 (run script) S4A still tries to run .ah2 scripts with ..\AutoHotkey.exe (the v1 executable).

User avatar
FanaticGuru
Posts: 1908
Joined: 30 Sep 2013, 22:25

Re: SciTE4AutoHotkey v3.1 portable: run .ah2/.ahk extension with v2/v1 ?

Post by FanaticGuru » 28 Oct 2022, 22:11

neogna2 wrote:
28 Oct 2022, 04:44
How do we configure SciTE4AutoHotkey v3.1 portable to run .ah2/.ahk files with the v2/v1 executable based on file extension alone (not #Requires lines)?

I have edited SciTEUser.properties like @FanaticGuru suggested in this post :

Code: Select all

file.patterns.ahk=*.ahk;*.ah2
file.patterns.ahk1=*.ahk
file.patterns.ahk2=*.ah2
ah2.file.extension=*.ah2
filter.ahk=\
AutoHotkey scripts (*.ahk)|$(ahk.file.extension)|\
AutoHotkey v2 scripts (*.ah2)|$(ah2.file.extension)|\
AHK scriptlets (*.scriptlet)|$(ahkscriptlet.file.extension)|
and placed a copy of the v2 executable at this relative path to S4A
C:\example\SciTe\
C:\example\v2\AutoHotkey64.exe


But when I press F5 (run script) S4A still tries to run .ah2 scripts with ..\AutoHotkey.exe (the v1 executable).

SciTE4AutoHotkey does not run the file with the correct version of AutoHotkey automatically. There is a button in the toolbar that has two "H"s overlaying. When you hover over it, it says "Set current platform". You have to click that to change between v1 and v2. This will change the highlighting rules and which exe is used to execute the script. It basically changes SciTE4AutoHotkey between v1 and v2 mode. You could simultaneously have a "Python" mode for editing and running Python scripts or other programming languages as SciTE is designed to be a universal programming editor and SciTE4AutoHotkey is just a preconfigured version of that universal editor.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks

neogna2
Posts: 600
Joined: 15 Sep 2016, 15:44

Re: SciTE4AutoHotkey v3.1 portable: run .ah2/.ahk extension with v2/v1 ?

Post by neogna2 » 29 Oct 2022, 04:53

FanaticGuru wrote:
28 Oct 2022, 22:11
SciTE4AutoHotkey does not run the file with the correct version of AutoHotkey automatically. There is a button in the toolbar that has two "H"s overlaying.
Ok thanks. A bit messy to use S4A to edit and test v1 and v2 scripts in different tabs ATM then since the platform setting is global and there's no visual cue (statusbar, HH icon, ...) for which platform is active, apart from the HH icon menu itself. But I see work in progress >3.1 code adds platform autodetection which is good news
https://github.com/fincs/SciTE4AutoHotkey/commit/16b5e00dc8b9eda2faad45d30dd9c6958d3fae61
edit: ... though after skimming through the commit some more it seems the upcoming autodetect will rely on the AutoHotkeyUX stuff from the new installer which is designed to use the same .ahk extension for v1/v2 and inline #Requires or code parsing to pick the run executable, so no good news for my use case here after all, unless the autodetect plan changes to include an alternative autodetect mode where .ahk = v1 and .ah2 = v2.

Post Reply

Return to “SciTE4AutoHotkey”