I must say I didn't knew the first dialog box you shown, "Edit system variable"
I tried :
Code:
EnvGet, OutputVar, tts
msgbox %OutputVar%
to see if there is an environement variable called tts, it isn't the case.
I seen the (affected ?) value of this variable is the path and the name of your vbs file.
Of course in Windows, if you double click a vbs file, it is executed.
I think that is what is done by :
Code:
%tts% "this is a test"
So what you done via the Run dialog box is the same as to execute your script (c:\scripts\speak.vbs) with "this is a test" as parameter.
Code:
%tts% "this is a test"
is the same as to write in the Window's Run dialog
Code:
c:\scripts\speak.vbs "this is a test"
(It should be usefull to see the content of the VBS script itself...)
But in AHK (as far as I know),
Code:
c:\scripts\speak.vbs "this is a test"
can't work. You must specify the program used to run the vbs file. So to run your script you should write something like that :
Code:
VBSScript := "c:\scripts\speak.vbs"
TextToSpeak := "this is a test"
RunWait, cscript.exe //nologo "%VBSScript%" %TextToSpeak%",,Hide