[Resolved] Print to Console

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
birbird
Posts: 15
Joined: 30 Jun 2015, 02:59

[Resolved] Print to Console

02 Jul 2015, 02:34

I am new to AutoHotKey.
I use SciTE4AutoHotKey, need print some log when debugging.
Is there something like ConsoleWrite of AutoIt in AutoHotKey?

Any help will be highly appreciated! :D
Last edited by birbird on 02 Jul 2015, 03:16, edited 2 times in total.
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: Print to Console

02 Jul 2015, 02:37

I could be wrong but I think if you put OutputDebug,[your text here] it will display in the debugger
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Print to Console

02 Jul 2015, 02:46

If you write to stdout (when running the script via SciTE), it will appear in SciTE's output pane:

Code: Select all

; Method 1
FileAppend line 1`n, *

; Method 2
stdout := FileOpen("*", "w")
stdout.WriteLine("line 2")
stdout.WriteLine("line 3")
maestrith: Only if you are debugging (not just running) the script.
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: Print to Console

02 Jul 2015, 02:48

lexikos wrote:If you write to stdout (when running the script via SciTE), it will appear in SciTE's output pane:

Code: Select all

; Method 1
FileAppend line 1`n, *

; Method 2
stdout := FileOpen("*", "w")
stdout.WriteLine("line 2")
stdout.WriteLine("line 3")
maestrith: Only if you are debugging (not just running) the script.
Good to know :)
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
birbird
Posts: 15
Joined: 30 Jun 2015, 02:59

Re: Print to Console

02 Jul 2015, 02:55

maestrith wrote:I could be wrong but I think if you put OutputDebug,[your text here] it will display in the debugger
Thanks for your reply. It helps.
But it can only work under debug mode, printing message in a stream viewer window.
When I say debug, I mean finding problem of the programm.

Just like AutoIt, many other languages can simplely output to the console.
Java: System.out.println
JavaScript: Console.log
ruby: puts
...

I am finding something like that. :)
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: Print to Console

02 Jul 2015, 02:58

Ah, sorry. When I read your original post you had mentioned "debug" so I assumed that you meant you were debugging....I suppose we all know what happens when we assume.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
birbird
Posts: 15
Joined: 30 Jun 2015, 02:59

Re: Print to Console

02 Jul 2015, 02:58

lexikos wrote:If you write to stdout (when running the script via SciTE), it will appear in SciTE's output pane:

Code: Select all

; Method 1
FileAppend line 1`n, *

; Method 2
stdout := FileOpen("*", "w")
stdout.WriteLine("line 2")
stdout.WriteLine("line 3")
maestrith: Only if you are debugging (not just running) the script.
Thanks a lot.
This is exactly what I want. :bravo:
birbird
Posts: 15
Joined: 30 Jun 2015, 02:59

Re: Print to Console

02 Jul 2015, 03:00

maestrith wrote:Ah, sorry. When I read your original post you had mentioned "debug" so I assumed that you meant you were debugging....I suppose we all know what happens when we assume.
It is so kind of you. Thank you so much.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, jomaweb, mikeyww, RussF and 307 guests