Gui - Error Message (ErrorStdOut)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
eqv
Posts: 72
Joined: 18 Sep 2018, 22:17

Gui - Error Message (ErrorStdOut)

18 Jun 2019, 11:40

Hello, regarding the Gui error messages, it's possible to:
• send them to StdOut? (through #ErrorStdOut, /ErrorStdOut, or other way)
• disable them? (less preferable)
• automatic stop the script? (less less preferable)

For example this code pop up the error message:

Code: Select all

#ErrorStdOut
varSearch = BMW
width = 100
gui, add, edit, % "x7 y+10 w" (Width-14) "r1 +0x4000 vvarSearch", %varSearch%
gui, add, text, gGoogle,search Google 
gui, show, autosize
Return
And this code don't:

Code: Select all

#ErrorStdOut
Msgbox % "Test
Currently I lunch a tooltip if there is an error (using /ErrorStdOut); and I would like to be the same with the Gui error message (and any other message like the ComObj).

Thanks in advance,
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: Gui - Error Message (ErrorStdOut)

18 Jun 2019, 11:56

Try this:

Code: Select all

#ErrorStdOut
varSearch = BMW
width = 100
gui, add, edit, % "x7 y+10 w" (Width-14) "r1 +0x4000 vvarSearch", %varSearch%
try gui, add, text, gGoogle,search Google
catch Error
    MsgBox, % Error.Line
gui, show, autosize
Return
I hope that helps.
eqv
Posts: 72
Joined: 18 Sep 2018, 22:17

Re: Gui - Error Message (ErrorStdOut)

18 Jun 2019, 12:31

wolf_II wrote:
18 Jun 2019, 11:56
Try this:

Code: Select all

#ErrorStdOut
varSearch = BMW
width = 100
gui, add, edit, % "x7 y+10 w" (Width-14) "r1 +0x4000 vvarSearch", %varSearch%
try gui, add, text, gGoogle,search Google
catch Error
    MsgBox, % Error.Line
gui, show, autosize
Return
I hope that helps.
Thank you :D .
Not exactly what I wanted, but it helps. I lunch scripts from text selection (fast for testing), clipboard, or file content, and the catch would modify the amount of lines. But I could automatic add "Try" to gui's to disable its message :thumbup: . (I won't mark it as an answer because my main objective was to address the ErrorStdOut; which I searched previously and didn't find)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, OrangeCat and 183 guests