autoitscript-debugging

Debugging an AutoIt script or get currently executed script line number


My AutoIt script sends a list of clicks and key-presses to automate an old closed source application.

It has bugs so I want to know how I can debug AutoIt scripts. Or at least output the script's line number (to show code executed in real time).


Solution

  • In SciTE from Tools select “Trace: Add trace lines”. This will add a ConsoleWrite to each line if nothing is selected. If you select some code first it will add ConsoleWrite lines to what you have selected.

    If you are getting an error in your compiled code you can add this to the top of your script before compiling it. When it errors out it will give you the right line number in your script.

    #Au3Stripper_Parameters=/mo