5 ms·
I'm not an expert, but these are basically the changes I would see that need to happen: All of the places where you use commands no longer need a preceding com
by ddtaylor 4y ago
I'm not an expert, but these are basically the changes I would see that need to happen:
All of the places where you use commands no longer need a preceding comma:
Run, Calc.exe
This is now just:
Run "Calc.exe"
Similarly, all areas where you use strings now need to be quoted:
Send, https://discord.gg/6SNQ4c6
Will now have to be:
Send "https://discord.gg/6SNQ4c6"
AFAIK the area where you use "blocks" of code like this:
^!+x::
... stuff ...
Will now have to be enclosed in curly braces:
^!+x:: {
... stuff ...
}
Where you use special constant/strings for the "Send" command now needs to use regular strings:
Send "+{Tab}+{Tab} {Space} {Esc}"
Where you do an "if" condition like this:
IfWinNotExist ahk_class MozillaWindowClass
return
Will have to turn into something like:
if (not WinExist("ahk_class MozillaWindowClass")) {
return
}
A full list of the differences is available at https://www.autohotkey.com/docs/v2/v2-changes.htm https://www.autohotkey.com/docs/v2/v2-changes.htm
- RheingoldRiver 4y agooh wow, that's a pretty comprehensive set of changes, thanks for the reply! I'll procrastinate on this a bit then, it looks like it'll be closer to an hour than five minutes, although not too bad simply because it's not that big a file.
- oefnak 4y agoOr you could ask ChatGPT to rewrite your scripts, maybe just give them the rules above.
- RheingoldRiver 4y agoI tried. I really, really, really tried. It......can't do it. There's a few rules OP left out (or I guess, glossed over as a generalization), like IfWinActive now needs to enclose its stuff in braces and that's just too much for it. I put its first attempt as well as its last two here: https://github.com/RheingoldRiver/misc_settings/issues/3 https://github.com/RheingoldRiver/misc_settings/issues/3 After I read the changes it told me it made (I always do something like this to get it to check its own work) I was like "hm this is sus as fuck" so I had it redo it several times and then yeah just....gave up. Good idea though, and I did learn a bunch about the syntax so when I go to do it myself it'll be easier. I wonder if some of what OP said was determined later than GhatGPT's cutoff date, although I don't think so - I remember even back when I set up these hotkeys 2.0 was in an early beta and I was like uhhhhhh no there's almost 0 docs on this, but I thought I might regret it one day; I don't, though, there were 0 docs back then, it was the right call.
- Fnoord 4y agoYes I was busy for an hour (I switched a month or so ago) with my 1k script and I am a lousy programmer. However every error was easy to debug. The documentation was ace (probably even better now?), and when I got stuck regardless a couple of search engine queries got me covered.