Default AHKv2 File Extension

Discuss the future of the AutoHotkey language
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Default AHKv2 File Extension

24 Oct 2022, 19:20

Is there a definition for the default file extension of AHKv2 scripts other than the conflicting, ambiguous, .ahk extension?
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Default AHKv2 File Extension

25 Oct 2022, 01:26

a hack workaround was decided to keep the same extension:
https://lexikos.github.io/v2/docs/Program.htm#launcher

details and code here:
viewtopic.php?f=37&t=104935

User avatar
boiler
Posts: 16978
Joined: 21 Dec 2014, 02:44

Re: Default AHKv2 File Extension

25 Oct 2022, 13:56

I realize that the issue is closed for debate, but another reason to have different extensions (and perhaps the reason Alguimist is epsecially interested) is that with different extensions, you can use the same code editor that will apply different syntax highlighting, parameter hints, and other features based on each version.

I also think it would make sense to use .ah or .ah2. The name of the language is AutoHotkey, after all -- not AutoHotKey.
User avatar
dJeePe
Posts: 20
Joined: 21 Oct 2022, 08:53

Re: Default AHKv2 File Extension

26 Oct 2022, 07:33

you are absolutely right
everything about V1 or V2 makes me upset

And since I use the portable versions, why couldn't the 2 versions cohabit on my pc?
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: Default AHKv2 File Extension

26 Oct 2022, 15:53

I think the interpreter should not be responsible for this distinction. And that an AHS extension (such as in "Automation. Hotkeys. Scripting.") should be officially adopted.
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: Default AHKv2 File Extension

27 Oct 2022, 09:13

@Alguimist You could be interested in reading this thread that has some comments made by Lexikos: viewtopic.php?f=82&t=108771
User avatar
poa
Posts: 6
Joined: 11 Oct 2023, 03:10
Contact:

Re: Default AHKv2 File Extension

11 Dec 2023, 16:33

@boiler Not that I disagree with your point, (and chances are you and the others on the thread are already aware of text editors with this functionality), but at the risk of stating the obvious, VS Code -- and probably other editors as well -- supports glob patterns in its JSON settings file, allowing a User to set configurations, not just based on the language / extension of a script file, but based on directory, or any part of the path name. So for instance, you could have it set up so that any file (regardless of what the extension or even if it has no extension) opened in a directory that matches the pattern

Code: Select all

 */ahk1/*.* 
will open using the settings you chose specifically for version 1 scripts. And you could have an entirely different configuration for files opened in a directory matching the pattern

Code: Select all

*/ahk2/*.*
where the file has any level parent folder in the workspace named ahk2, regardless of the script files actual extension.

Again, this is likely news to no one, but I only became aware of it for the first time a couple of weeks ago, having never before seen configurations that allowed wild cards, so the awe/wonder has yet to wear off this old-timer completely.

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 115 guests