-topic moved-
Re: Track script code
If you are fast enough with your eye! Maybee? if you can read with speed a speed of 20ms each line number.
No i dont think there is one. I use trayicon open and Pause the script.
No i dont think there is one. I use trayicon open and Pause the script.
Re: Track script code
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!
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!
I am your average ahk newbie. Just.. a tat more cute.
Re: Track script code
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.
The help for Scite4AHK has a section named "Debugging AutoHotkey scripts" that gives a small summary. Other editors may have similar functions.
Re: Track script code
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
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
Who is online
Users browsing this forum: inseption86, jaka1, metallizer, Rohwedder and 329 guests