A better converter for migrating from V1 please

Propose new features and changes
Textdoktorn
Posts: 1
Joined: 19 Mar 2024, 03:46

A better converter for migrating from V1 please

19 Mar 2024, 04:13

Hi,

I've had two frustrating working days of trying to make my fully functional (and not too complicated but large) V1 script work after using the built-in V1 to V2 conversion tool. There were a great many errors when compiling, and when I had finally managed to reload the converted script without error messages, the hotkeys didn't work and generated lots of new error messages, such as

Expected a String but got a Func
Duplicate key
Bad syntax
This line does not contain a recognized action
This variable has not been assigned a value
etc. etc. etc.

Especially the HotifWinactive command caused me a lot of problems, although my IfWinActive commands worked fine in V1.

I hope there will be a more useful converter in place before it's time to ditch V1.
User avatar
boiler
Posts: 16978
Joined: 21 Dec 2014, 02:44

Re: A better converter for migrating from V1 please

19 Mar 2024, 04:30

Textdoktorn wrote: …after using the built-in V1 to V2 conversion tool.
What built-in v1-to-v2 conversion tool?

Textdoktorn wrote: Especially the HotifWinactive command caused me a lot of problems, although my IfWinActive commands worked fine in V1.
HotIfWinactive (v2) affects hotkeys. IfWinActive (v1) has nothing to do with hotkeys. If you mean v1’s directive #IfWinActive, then in v2, you would use #HotIf with WinActive to do the same.
User avatar
MC256
Posts: 2
Joined: 19 Dec 2020, 20:03

Re: A better converter for migrating from V1 please

28 Mar 2024, 01:55

I think Textdoktorn is referring to this fairly comprehensive and impressive effort: https://github.com/mmikeww/AHK-v2-script-converter
I'm sorry to say that this is probably the best you're going to get. We might be able to do something more structural with the LSPs that were developed for VSCode, but that's a big lift too.

FWIW, if you're subscribed to ChatGPT, I created a Custom GPT that has access to all of the AHK1 docs, AHK2 docs, the source code to AHK-v2-script-converter, and its unit tests. Plus I gave it some extra guidance on V1->V2. At this point the GPT is pretty smart about conversions. If it gets off track, just point it out and ask it to re-consult its knowledge files. It typically gets back on track after that. => https://chat.openai.com/g/g-3OSTIgi6X-autohotkey-expert
User avatar
Animan8000
Posts: 58
Joined: 11 May 2022, 05:00
Contact:

Re: A better converter for migrating from V1 please

30 Mar 2024, 12:18

There's no "built-in converter". Only finished scripts made by other people. These converters are okay for the most part, but limitations will apply. The v2 documentation is likely still the best reference, to figure the differences out.
User avatar
xMaxrayx
Posts: 165
Joined: 06 Dec 2022, 02:56
Contact:

Re: A better converter for migrating from V1 please

17 Apr 2024, 09:24

why just use the old scripts without converting? It's just better create from ground up rather than conversion because you don't need to deal with bugs.
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 47 guests