Is it possible to have Autohotkey v1 and v2 on one computer? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
LAPIII
Posts: 667
Joined: 01 Aug 2021, 06:01

Is it possible to have Autohotkey v1 and v2 on one computer?

Post by LAPIII » 04 Feb 2023, 17:08

I want to upgrade to v2, but some libraries that I use haven't been converted.

User avatar
Chunjee
Posts: 1400
Joined: 18 Apr 2014, 19:05
Contact:

Re: Is it possible to have Autohotkey v1 and v2 on one computer?

Post by Chunjee » 04 Feb 2023, 17:11

Yes, its possible.

Generally just install v1 then install v2


You can get more complicated than that but I find that my IDE VSCode gets confused if you have a complex configuration


LAPIII
Posts: 667
Joined: 01 Aug 2021, 06:01

Re: Is it possible to have Autohotkey v1 and v2 on one computer?

Post by LAPIII » 05 Feb 2023, 19:19

What I did not know is that I need a new file extension and to connect that file extension Autohotkey v2, as explained in How to Fool Around with the New AutoHotkey Version 2.0. Is this process explained in the docs so that new v2 can transition easier? If so then I want to read what file extension they recommend, if they don't then what do you recommend (I want to use what everyone's using).

EDIT: I'm don't know which file to associate the extension with AutoHotkey 64 or AutoHotkey 64_UIA from the folder C:\Program Files\AutoHotkey\v2.

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

Re: Is it possible to have Autohotkey v1 and v2 on one computer?

Post by boiler » 05 Feb 2023, 19:44

LAPIII wrote: What I did not know is that I need a new file extension and to connect that file extension Autohotkey v2, as explained in How to Fool Around with the New AutoHotkey Version 2.0.
You don’t. That advice/instruction is misguided. You use the .ahk extension for both, and the launcher will determine which version a script needs and run the appropriate one, especially if you use #Requires (link for v1) and #Requires (link for v2) at the top of your script to identify the version it was written in.

LAPIII wrote: Is this process explained in the docs so that new v2 can transition easier?
Yes — the link is in my last post. And that explanation doesn’t say anything about different extensions because that’s not what’s recommended.

LAPIII wrote: If so then I want to read what file extension they recommend, if they don't then what do you recommend (I want to use what everyone's using).
The extension I recommend and what (almost) everyone is using .ahk.

LAPIII wrote: I'm don't know which file to associate the extension with AutoHotkey 64 or AutoHotkey 64_UIA from the folder C:\Program Files\AutoHotkey\v2.
Don’t do any associations yourself. Just run the installers as outlined in the documentation.

LAPIII
Posts: 667
Joined: 01 Aug 2021, 06:01

Re: Is it possible to have Autohotkey v1 and v2 on one computer?

Post by LAPIII » 05 Feb 2023, 19:54

Thank you, I see what the problem was. In Scite4Autohotkey, when running a script, it says "This script requires AutoHotkey v2.0-.". I found instructions on how to change this at https://www.autohotkey.com/scite4ahk/pages/ahkv2.htm.

LAPIII
Posts: 667
Joined: 01 Aug 2021, 06:01

Re: Is it possible to have Autohotkey v1 and v2 on one computer?

Post by LAPIII » 09 Feb 2023, 13:14

I converted some scripts that I had in the startup folder and now when I startup, I get these windows:

Run_Restart.ahk_with 09_02_23 08⦂59⦂57⦂670 AM.jpg
Run_Restart.ahk_with 09_02_23 08⦂59⦂57⦂670 AM.jpg (7.78 KiB) Viewed 991 times

Is there a way that I can make these not come up without uninstalling version 1?

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

Re: Is it possible to have Autohotkey v1 and v2 on one computer?

Post by boiler » 09 Feb 2023, 13:16

boiler wrote:
05 Feb 2023, 19:44
..the launcher will determine which version a script needs and run the appropriate one, especially if you use #Requires (link for v1) and #Requires (link for v2) at the top of your script to identify the version it was written in.

Post Reply

Return to “Ask for Help (v2)”