-topic moved-

Get help with using AutoHotkey and its commands and hotkeys
Yaosr
Posts: 53
Joined: 04 Nov 2017, 04:59

-topic moved-

13 May 2018, 05:46

-topic moved-
Last edited by Yaosr on 13 Jun 2018, 08:12, edited 1 time in total.
User avatar
Frosti
Posts: 341
Joined: 27 Oct 2017, 14:30
GitHub: Ixiko

Re: Track script code

13 May 2018, 08:48

If you are fast enough with your eye! Maybee? if you can read with speed a speed of 20ms each line number. :crazy:
No i dont think there is one. I use trayicon open and Pause the script.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Track script code

13 May 2018, 09:59

Hey bud,

If you're trying to trace the actions and calculations of your ahk script then double click the script's tray icon when it's running. It should pop up a neat log. Hope that helps.

Cheers! :D
I am your average ahk newbie. Just.. a tat more cute. ;)
gregster
Posts: 4652
Joined: 30 Sep 2013, 06:48

Re: Track script code

13 May 2018, 10:11

Many editors like Scite4AutoHotkey have debugging functions that let you "step" through the code line by line, or by setting certain "breakpoints" .
The help for Scite4AHK has a section named "Debugging AutoHotkey scripts" that gives a small summary. Other editors may have similar functions.
Guest

Re: Track script code

14 May 2018, 09:13

The "double click the tray icon" might be the easiest answer as it shows the line last executed and some data (variables).

If that doesn't help there will me no "easy" solution.

Just some general info below - you will need to learn some code and concepts if you want to do this, but it may well worth be the investment (you learn more about AutoHotkey and in the end will have a more stable script)

You can find some editors with debugging options here:
https://autohotkey.com/boards/viewforum.php?f=60
(I believe SciTE4AutoHotkey, AHK Studio and AutoGUI have such an option)

There is also some (sparse) information in the documentation on Debugging here:
https://autohotkey.com/docs/Scripts.htm#debug

Now that looks fairly complex and might be overkill.

What you could do is write your own solution(s):

a) Continuous logging:

- Write a piece of code that writes data of the script (where it is and what data it is using) to a log file using FileAppend
- At several points in your script simply Gosub or Call a function so you can keep track of "script is now in step 1, using this data and it went OK/Bad"

When you close your script you can open the log file (just a text file afterall) and see the results

b) Logging on Exit:

- Setup a Hotkey to close the Script (esc::ExitApp)
- In your script set a variable at various points, say CurrentAction:="start", CurrentAction:="step 1" etc whatever may be useful
- Add an OnExit label to your script (look that up in the docs)
- Have the OnExit label write that CurrentAction variable to a log file using FileAppend

So now when you close your script (when you notice something has stopped or has gone wrong) you can see the last step executed in the log file and use that to debug that particular step

Return to “Ask For Help”

Who is online

Users browsing this forum: boiler, enrica, spiroX and 41 guests