Geek idea: Talking MsgBox for debugging...

Discuss Autohotkey related topics here. Not a place to share code.
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
User avatar
kunkel321
Posts: 1194
Joined: 30 Nov 2015, 21:19

Geek idea: Talking MsgBox for debugging...

Post by kunkel321 » 10 Aug 2023, 14:52

I'm not a professional programmer, so writing scripts in AHK involves a lot of debugging and trial-n-error. My two main ways to debug are:
1. Ample use of MsgBox to show me what line the code it on.
2. SoundBeeps of various durations and frequencies, for the same reason.

What if we combine those two things with a "Talking MsgBox?" This would be like a separate library. Put "#Include TalkingLib" or whatever in the top of your script during debugging. It would be called via Talk("text to speak").
ste(phen|ve) kunkel

RussF
Posts: 1311
Joined: 05 Aug 2021, 06:36

Re: Geek idea: Talking MsgBox for debugging...

Post by RussF » 11 Aug 2023, 05:29

No need for a library.

Code: Select all

#Requires AutoHotkey v1.1.33+
ComObjCreate("SAPI.SpVoice").Speak("Peter Piper picked a peck of pickled peppers")

Code: Select all

#Requires AutoHotkey v2.0+
ComObject("SAPI.SpVoice").Speak("Peter Piper picked a peck of pickled peppers")
Russ

User avatar
kunkel321
Posts: 1194
Joined: 30 Nov 2015, 21:19

Re: Geek idea: Talking MsgBox for debugging...

Post by kunkel321 » 11 Aug 2023, 11:19

RussF wrote:
11 Aug 2023, 05:29
No need for a library.

Code: Select all

#Requires AutoHotkey v1.1.33+
ComObjCreate("SAPI.SpVoice").Speak("Peter Piper picked a peck of pickled peppers")

Code: Select all

#Requires AutoHotkey v2.0+
ComObject("SAPI.SpVoice").Speak("Peter Piper picked a peck of pickled peppers")
Russ
This is excellent! Thanks Russ!
ste(phen|ve) kunkel

Post Reply

Return to “General Discussion”