DranDane:
a pretty cob solution to the pausing script (which i use for a few functions as a multithreading tool, tested only in xp) as follows, which basically calls a second instance of the script with a command line parameter, that instance only alive to say what needs to be said and then die...
Code:
#SingleInstance, Off
#NoEnv
SetWorkingDir %A_ScriptDir%
SplitPath, A_ScriptFullPath,, Path,Ext,Name
If %0%
GoSub, SI_Ran
Notify("TTS Test","click to close",-300)
TTS("Testing, 1, 2, 3.")
Notify("done talking, see the delay?","click to show second instance behavior (or CTRL-F1)",0,"AC=SI_Start")
Return
^F1::
SI_Start:
If A_IsCompiled
ToRun := A_ScriptFullPath
Else
ToRun := A_AhkPath """ """ A_ScriptFullPath
SayThis = This is the second instance speaking a really long sentence. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Run, "%ToRun%" "%SayThis%"
Sleep 100
Notify("First Instance doing something else")
Loop 10
Notify("","",-1,"Wait",Notify(A_Index))
Return
SI_Ran:
ToSay = %1%
Notify("Second Instance saying:",ToSay,0,"GC=Red")
TTS(ToSay)
ExitApp
Return
^1::Reload
#Include *i TTS.ahk
#Include *i Notify.ahk ;= http://www.autohotkey.com/forum/viewtopic.php?t=48668
EDIT: replaced with fully working example showing the second instance behavior, a simple way to prevent the paused script during an asynchronous dllcall or ahk feature (beep...) not very elegant but a 250kb ahk exe running is a small price to pay for the functionality (cmdret and getmail work beautifully with this method)
Note: this example requires Notify() in scripts dir or stdLIB dir, mainly to show you whats going on, so you replace those calls if you prefer, otherwise get it here:
http://www.autohotkey.com/forum/viewtopic.php?t=48668
- gwarble
EDIT: this functionality has been wrapped into Instance() [stdlib] function
http://www.autohotkey.com/forum/viewtopic.php?t=51159
also, if you use TTS (ever) i strongly recommend vista's Anna voice over any xp voice i've tried (except maybe "toshiba adult male" but i can't find it anywhere)... you can get Anna for XP here
http://www.autohotkey.com/forum/viewtopic.php?t=51489