WinMenuSelectItem causes "requires v1" error

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
rea5245
Posts: 2
Joined: 29 May 2023, 21:17

WinMenuSelectItem causes "requires v1" error

Post by rea5245 » 29 May 2023, 21:24

Hi. I'm using AHK 2.0.2. I have the code:

Code: Select all

eeschema := WinExist("CPU2 — Schematic Editor")
if (eeschema = 0)
{
    run "CPU2.kicad_sch"
    winwait "CPU2 — Schematic Editor"
    eeschema := WinExist("CPU2 — Schematic Editor")
}
WinMenuSelectItem, ahk_id %eeschema%, , File, Export, Netlist
When it hits the WinMenuSelectItem line, I get the error "It looks like the script you are trying to run requires AutoHotKey v1".

What am I doing wrong?

Thank you.

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

Re: WinMenuSelectItem causes "requires v1" error

Post by boiler » 29 May 2023, 21:39

I don’t know how it could be more clear that that line is v1 syntax and that you need to look up how to write it in v2. Not only is there no WinMenuSelectItem in v2, everything about how that line is written is in v1 syntax.

(Hint: See MenuSelect.)

rea5245
Posts: 2
Joined: 29 May 2023, 21:17

Re: WinMenuSelectItem causes "requires v1" error

Post by rea5245 » 30 May 2023, 06:37

Thank you. I'm new to AHK, and apparently I was somehow looking at the old documentation. <sheepish grin>

Post Reply

Return to “Ask for Help (v2)”