But I also see that I could solve it using dll1.ahkTerminate(-1) to force the termination. My question is how ahkTerminate works and is there any potential problem using dll1.ahkTerminate(-1) or dll1.ahkTerminate(-500) or even dll1.ahkTerminate(-0) instead of dll1.ahkTerminate(). What is the safest way to terminate potentially problematic script? Thanks.
Code: Select all
string:="
(
#Persistent
;Doesn't work
mx:=ComObjCreate(""Outlook.Application"")
m:=mx.CreateItem(0)
;This works
;m:=ComObjCreate(""Outlook.Application"").CreateItem(0)
m.Body:=""My body ...""
m.Display
return
)"
dll1:=ahkThread(string)
msgbox Try second time...
dll1.ahkTerminate()
dll1:=ahkThread(string)
return