AHK V1 Scripts working with v2?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Quiffster
Posts: 2
Joined: 02 Feb 2023, 10:24

AHK V1 Scripts working with v2?

Post by Quiffster » 02 Feb 2023, 10:28

Apologies if this is answered elsewhere (coming up with the right search term is hard without so many results !!)
Simple question: Can I use my V1 script directly with V2 - or do I need a rewrite / conversion?

Thanks.

Baconfry
Posts: 14
Joined: 07 Jan 2022, 04:07

Re: AHK V1 Scripts working with v2?

Post by Baconfry » 02 Feb 2023, 11:11

Most of the time you'd need to rewrite your code. There are a lot changes.

Simple answer: probably no.
Last edited by Baconfry on 02 Feb 2023, 12:03, edited 1 time in total.

User avatar
mikeyww
Posts: 26875
Joined: 09 Sep 2014, 18:38

Re: AHK V1 Scripts working with v2?

Post by mikeyww » 02 Feb 2023, 11:13

If you install v2, your v1 & v2 programs will exist concurrently. Your v1 scripts can continue to run with the v1 interpreter, with no changes from you. If you wish to convert your v1 scripts to v2, you also have that option.

Quiffster
Posts: 2
Joined: 02 Feb 2023, 10:24

Re: AHK V1 Scripts working with v2?

Post by Quiffster » 02 Feb 2023, 12:41

mikeyww wrote:
02 Feb 2023, 11:13
If you install v2, your v1 & v2 programs will exist concurrently. Your v1 scripts can continue to run with the v1 interpreter, with no changes from you. If you wish to convert your v1 scripts to v2, you also have that option.
Thank you Mikey. For clarity -when you say "convert" do you mean rewrite, or is there a process / tool? my script is very simple, but its long (essentially a huge autocorrect script)...

User avatar
mikeyww
Posts: 26875
Joined: 09 Sep 2014, 18:38

Re: AHK V1 Scripts working with v2?

Post by mikeyww » 02 Feb 2023, 12:56

You can translate the script yourself, or try the converter.

viewtopic.php?f=76&t=113386

Some scripts will require no conversion.

Code: Select all

;#Requires AutoHotkey v1.1.33
#Requires AutoHotkey v2.0
::a::b
The real question to answer is why: why one wants to convert a script. There might be a good reason, or there might not.

Post Reply

Return to “Ask for Help (v2)”