[Resolved] Print to Console

Get help with using AutoHotkey 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: 788
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
AHK Studio OSD GUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
lexikos
Posts: 6586
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

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: 788
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 :)
AHK Studio OSD GUI 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: 788
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.
AHK Studio OSD GUI 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”

Who is online

Users browsing this forum: elvisautohotkey and 54 guests