Autohotkey Getting EditBox Variable Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Asansor232
Posts: 30
Joined: 05 Apr 2022, 10:37
Contact:

Autohotkey Getting EditBox Variable

16 Dec 2023, 17:43

Hello everyone, Im making console for my script and it does NOT work

Code: Select all

Gui Console: Font, cBlack s14
Gui Console: Add, Edit, x0 y0 h200 w500 vConsolelogger, started.
Gui Console: Show, h201 w501, Console
Gui Console: +AlwaysOnTop -SysMenu 
GuiControl Console: +Disabled, Consolelogger

Log(Logs) {
    Gui Console: Submit, NoHide
	GuiControlGet, Consolelagger, , %Consolelogger%
	GuiControl Console:, Consolelogger, %Consolelagger% `n%Logs%
	MsgBox, Değişken değeri: %Consolelagger%
    Gui Console: Submit, NoHide
}
Log("Hi")
Log("Hi")
This script does, logs everything when "Log" function is executed it will use new line but for some reasons i trying this in 2 hours and it didnt even work.
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: Autohotkey Getting EditBox Variable

16 Dec 2023, 17:55

Debugging this is straightforward, because you can quickly display the values of your variables to see where you went wrong.

Code: Select all

#Requires AutoHotkey v1.1.33
Global Consolelogger
Gui +AlwaysOnTop -SysMenu
Gui Font, cBlack s14
Gui Margin, 2, 2
Gui Add, Edit, w500 r15 vConsolelogger, Started.
Gui Show,, Console

F3::
Log("Hi")
Log("Hi")
Return

Log(Logs) {
 Gui Submit, NoHide
 GuiControl ,, Consolelogger, % Consolelogger "`n" Logs
}
Asansor232
Posts: 30
Joined: 05 Apr 2022, 10:37
Contact:

Re: Autohotkey Getting EditBox Variable

17 Dec 2023, 01:03

I guess there is an error on autohotkey,

Code: Select all

#Requires AutoHotkey v1.1.33
Global Consolelogger
Gui +AlwaysOnTop -SysMenu
Gui Font, cBlack s14
Gui Margin, 2, 2
Gui Add, Edit, w500 r15 vConsolelogger, Started.
Gui Show,, Console

F3::
Log("Hi")
Log("Hi")
Return

Log(Logs) {
 Gui Submit, NoHide
 GuiControl ,, Consolelogger, % Consolelogger "`n" Logs
}
This one worked but

Code: Select all

Global Consolelogger
Gui Console: +AlwaysOnTop -SysMenu
Gui Console: Font, cBlack s14
Gui Console: Margin, 2, 2
Gui Console: Add, Edit, w500 r15 vConsolelogger, Started.
Gui Console: Show,, Console

Log("Hi")


Log(Logs) {
 Gui Submit, NoHide
 GuiControl Console:,, Consolelogger, % Consolelogger "`n" Logs
}
This one not worked
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: Autohotkey Getting EditBox Variable

17 Dec 2023, 06:54

There is not an error in AutoHotkey but in your script.

Code: Select all

#Requires AutoHotkey v1.1.33
Global Consolelogger
Gui Console:New, +AlwaysOnTop -SysMenu
Gui Font, cBlack s14
Gui Margin, 2, 2
Gui Add, Edit, w500 r15 vConsolelogger, Started.
Gui Show,, Console

Log("Hi")

Log(Logs) {
 Gui Console:Default
 Gui Submit, NoHide
 GuiControl ,, Consolelogger, % Consolelogger "`n" Logs
}
Asansor232
Posts: 30
Joined: 05 Apr 2022, 10:37
Contact:

Re: Autohotkey Getting EditBox Variable

17 Dec 2023, 12:29

But i want in Gui Console: not Gui,
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: Autohotkey Getting EditBox Variable

17 Dec 2023, 13:31

This script has a single GUI. The GUI is named "Console". Run the script to see whether it works.
Asansor232
Posts: 30
Joined: 05 Apr 2022, 10:37
Contact:

Re: Autohotkey Getting EditBox Variable

17 Dec 2023, 13:52

But Gui is Used. I want Gui Console: or I want it in a different way.
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: Autohotkey Getting EditBox Variable

17 Dec 2023, 13:58

You are welcome to add the GUI name if you wish.
Asansor232
Posts: 30
Joined: 05 Apr 2022, 10:37
Contact:

Re: Autohotkey Getting EditBox Variable

17 Dec 2023, 14:13

no its not work by

Code: Select all

Gui Console: +AlwaysOnTop -SysMenu
Gui Console:Font, cBlack s14
Gui Console:Add, Edit, w500 r15 vConsolelogger, Started.
Gui Console:Show, Autosize, Consolelogger

Log("Hi")

Log(Logs) {
 Gui Console:Submit, NoHide
 GuiControl Console: , Consolelogger, % Consolelogger "`n" Logs
}
User avatar
V0RT3X
Posts: 362
Joined: 20 May 2023, 21:59
Contact:

Re: Autohotkey Getting EditBox Variable

17 Dec 2023, 15:12

I think this is what you are aiming for? Just a slight edit to what Mikey provided.
Just have to play with it a little to get it the way you need. You were close.
This work exactly the same as Mikey's does for me.

Code: Select all

#Requires AutoHotkey v1.1.33
Global Consolelogger
Gui Console:New, +AlwaysOnTop -SysMenu
Gui Console: Font, cBlack s14
Gui Console: Margin, 2, 2
Gui Console: Add, Edit, w500 r15 vConsolelogger, Started.
Gui Console: Show, Autosize, Console

Log("Hi")

Log(Logs) {
 Gui Console:Default
Gui Console: Submit, NoHide
 GuiControl Console:, Consolelogger, %Consolelogger% `n%Logs%
}
Asansor232
Posts: 30
Joined: 05 Apr 2022, 10:37
Contact:

Re: Autohotkey Getting EditBox Variable

18 Dec 2023, 06:15

Its an error

mikey gived a code with "Gui, "
and result is correct:
"Started
Hi"

But you gived a code with Gui, Console:
Its Not correct:
"
Hi"
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: Autohotkey Getting EditBox Variable  Topic is solved

18 Dec 2023, 07:06

This script is equivalent to what I posted earlier, though naming the GUI on every line is not necessary.

Code: Select all

#Requires AutoHotkey v1.1.33
Global Consolelogger
Gui Console:New, +AlwaysOnTop -SysMenu
Gui Console:Font, cBlack s14
Gui Console:Margin, 2, 2
Gui Console:Add, Edit, w500 r15 vConsolelogger, Started.
Gui Console:Show,, Console

Log("Hi")

Log(Logs) {
 Gui Console:Submit, NoHide
 GuiControl Console:, Consolelogger, % Consolelogger "`n" Logs
}
User avatar
V0RT3X
Posts: 362
Joined: 20 May 2023, 21:59
Contact:

Re: Autohotkey Getting EditBox Variable

18 Dec 2023, 07:42

@Asansor232, very odd as I get the same result from my edit as I do from Mikey's gift...

Mikey code:
image.png
image.png (41.73 KiB) Viewed 1182 times

My edit:
image.png
image.png (42.64 KiB) Viewed 1182 times
Asansor232
Posts: 30
Joined: 05 Apr 2022, 10:37
Contact:

Re: Autohotkey Getting EditBox Variable

18 Dec 2023, 09:33

can i also get auto scroll down when it updated?
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: Autohotkey Getting EditBox Variable

18 Dec 2023, 09:53

You can add to the end of the function.

Code: Select all

GuiControl Console:Focus, Consolelogger
Send ^{End}
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: Autohotkey Getting EditBox Variable

18 Dec 2023, 11:11

When you revise your script, please post it.
Asansor232
Posts: 30
Joined: 05 Apr 2022, 10:37
Contact:

Re: Autohotkey Getting EditBox Variable

18 Dec 2023, 11:24

Code: Select all

Global Consolelogger
Gui Console:+AlwaysOnTop -SysMenu
Gui Console:Font, cBlack s14
Gui Console:Add, Edit, w500 r15 vConsolelogger, Started.
Gui Console:Show,, Console
WinSet, Transparent, 180, Console

Log("Password are entered")

Log(Logs) {
 Gui Console:Submit, NoHide
 GuiControl Console:, Consolelogger, % Consolelogger "`n" Logs
 GuiControl Console:Focus, Consolelogger
Send ^{End}
}
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: Autohotkey Getting EditBox Variable

18 Dec 2023, 11:32

I tested your script and had no difficulty with it. Close other scripts before you run it.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, vanove and 178 guests