How to submit the GUI to get the value of the controls

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
poetbox
Posts: 112
Joined: 18 Apr 2018, 20:47

How to submit the GUI to get the value of the controls

22 Jul 2020, 05:25

---------------------------
AutoHotkeyU64.exe
---------------------------
Error: This value of type "String" has no method named "Submit".

Line#
---> 029: NamedCtrlContents := Gui.Submit()

The current thread will exit.
---------------------------
OK
---------------------------
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: How to submit the GUI to get the value of the controls

22 Jul 2020, 06:43

Gui is a reserved keyword, so u should have gotten a very different error long before that

Code: Select all

G := Gui.New()
G.Add('Edit', 'vEdit1', 'asdffasf')
NamedCtrlContents := G.Submit()
MsgBox NamedCtrlContents.Edit1
poetbox
Posts: 112
Joined: 18 Apr 2018, 20:47

Re: How to submit the GUI to get the value of the controls

23 Jul 2020, 22:48

@swagfag

Code: Select all

G := Gui.New()
G.Add('Edit', 'vEdit1', 'asdffasf')
NamedCtrlContents := G.Submit()
MsgBox NamedCtrlContents.Edit1
The four lines of code are still reporting errors as belove.

---------------------------
AutoHotkeyU64.exe
---------------------------
Error: This value of type "String" has no method named "New".

Line#
---> 001: G := Gui.New()

The current thread will exit.
---------------------------
OK
---------------------------

version:Version 2.0-a108-a2fa0498
:headwall:
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: How to submit the GUI to get the value of the controls

24 Jul 2020, 00:36

poetbox wrote:
23 Jul 2020, 22:48
version:Version 2.0-a108-a2fa0498
:headwall:
if you're going to use an old version, then you need to use the correct syntax for that old version

with a108 you need to use GuiCreate() function.

Gui.New() wasn't added until a112:
https://www.autohotkey.com/boards/viewtopic.php?p=337056#p337056

Code: Select all

G := GuiCreate()
G.Add('Edit', 'vEdit1', 'asdffasf')
NamedCtrlContents := G.Submit()
MsgBox NamedCtrlContents.Edit1

poetbox
Posts: 112
Joined: 18 Apr 2018, 20:47

Re: How to submit the GUI to get the value of the controls

24 Jul 2020, 05:02

Thank you!
I don't know if swagfag and guest3456 are the same person,I should accept one answer to mark the topic as Solved.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: How to submit the GUI to get the value of the controls

24 Jul 2020, 06:29

then accept the one that solved it(if any)

always specify versions, unless ure running the latest one. otherwise, the latest is assumed

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: No registered users and 31 guests