3

I wanted to debug AHK code that calls python script and batch file. I inserted "print SOMETHING" in the python script, but it doesn't seem that the result is shown to the console.

Is there a special trick to print out the debugging message?

When debugging AHK, what people normally use?

1
  • How you run the file Jun 26, 2019 at 13:12

3 Answers 3

1

In AHK, you can use MsgBox in the middle of the script, or using FileAppend in order to write into the file.

Otherwise can use SciTE4AutoHotkey, a lightweight and easy to use SciTE-based AutoHotkey script editor. It can provide interactive debugging.

See also: Debugging Clients.

1

A simple logging function for AutoHotkey v2:

; file log
flog(params*){
  logfile := "j:\d\AutoHotkeyLog.log"
  ts := FormatTime(, "yyyy-MM-dd HH:mm:ss.") substr(A_TickCount,-3)
  ; s := A_TickCount
  ; ts := substr(s,-6,3) "." substr(s,-3)
  for ,param in params
    message .= param . " "
  FileAppend ts " " message "`n", logfile
}

eg: flog "The value of i is " i
0

I found this page - http://www.autohotkey.com/forum/topic64248.html

I just put the code DebugMessage("") in front of code, and it seems to print the results on the console.

1
  • which results that prints Jun 26, 2019 at 13:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .