Closed Sperhak323 closed 1 year ago
Hi @Sperhak323, please check out these settings:
If you're still struggling, please paste a small script you're trying to run and some screenshots of your settings so I can assist further.
Thanks, first step works.
@mark-wiemer
The language mode is set to AHK v1...
I've noticed, if you create a new empty text file in explorer with an ahk extension and use the context menu to open it with VSCode, the file will be opened by default in v2 mode.
Yep @fade2gray, somehow it's defaulting to AHK v2 even though I don't want it to :/ I'm at work rn, feel free to open a bug for that but you should be able to change the default language association for .ahk
files to AHK v1 :)
@fade2gray By the way, do you know any way to automatically convert ahk-script from v1 to v2? It's qute tedious to do it manually.
That's why I posted my comment - I noticed that you posted a similar comment but deleted it.
https://github.com/mmikeww/AHK-v2-script-converter is a help, but it won't do it all for you.
@fade2gray how good it is when there are people like you in the world who will help when it's needed. I've just found the solution that's why I deleted my comment.
It is possible to set the default language for a file extension^1.
Add this to your settings file to associate .ahk with ahk v1:
"files.associations": {
"*.ahk": "ahk"
}
Use "ahk2" for ahk v2.
You can also associate specific folders to a certain language^2:
"files.associations": {
"**/somefolder/*.*": "ahk",
"**/otherfolder/*.*": "ahk2"
}
A glob pattern^3 is used for file matching.
I find that using .ah1
and .ah2
extensions just work out-of-the-box - no need for #Requires blah
.
How to run script as ahk v1? I cannot find any button or something. When i try run script with ctrl+F9 I get error from ahk because run it in v2 and i have script in v1 Thanks for reply.