AutoHotkey Community

It is currently May 27th, 2012, 10:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: June 17th, 2007, 10:30 pm 
Offline

Joined: April 29th, 2006, 10:31 am
Posts: 29
Location: Sweden
Supercalifragilistic wrote:
I must say I didn't knew the first dialog box you shown, "Edit system variable"

I was unclear - I've added this variable myself.

Quote:
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.

Correct.
Quote:
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

Which is pretty much the way I'm already doing it. What I would like to know is if there's any way to use a custom system variable something like this;

Code:
ExecuteSystemVariable, TTS "%name%"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 17th, 2007, 10:33 pm 
Offline

Joined: April 29th, 2006, 10:31 am
Posts: 29
Location: Sweden
Supercalifragilistic wrote:
It should be usefull to see the content of the VBS script itself...

Code:
Dim voic
Dim intValue

intValue = Wscript.Arguments.Item(0)
Set voic = WScript.CreateObject("SAPI.SpVoice")
Set voic.voice = voic.GetVoices("", "Language=809").Item(0)
voic.Speak("" + intValue + "")
Set voic = nothing


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 17th, 2007, 11:33 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
like I said, EnvGet...
Code:
EnvGet, tts, tts


then you can use %tts% anywhere

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 17th, 2007, 11:40 pm 
Offline

Joined: April 29th, 2006, 10:31 am
Posts: 29
Location: Sweden
engunneer wrote:
like I said, EnvGet...
Code:
EnvGet, tts, tts


then you can use %tts% anywhere

Code:
envget, tts, tts
name="this is a test"

run, %tts%, "%name%"

gives me the same error from the vbscript as in my first post... :(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 17th, 2007, 11:44 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
Code:
envget, tts, tts
name=this is a test

run, %tts%, "%name%"



:?:

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 17th, 2007, 11:51 pm 
Offline

Joined: April 29th, 2006, 10:31 am
Posts: 29
Location: Sweden
Same result...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 17th, 2007, 11:57 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
I was blind - the problem is obvious now that I see it

Code:
envget, tts, tts
name= this is a test

run, %tts% "%name%"


no Comma!, the comma made %name% the working directory, which is less useful.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 18th, 2007, 6:21 am 
m1m3r wrote:
What I would like to know is if there's any way to use a custom system variable something like this;

Code:
ExecuteSystemVariable, TTS "%name%"

Sorry I don't know the answer to that question. I hope that engunneer gave you the answer you was waiting for.
Just an other thing :
By doing like this (generate the VBS file from AHK and execute it), you haven't to transmit parameter :
Code:
VBSScript := "c:\scripts\speak.vbs"
intValue := "this is a test"

VBSfile =
(Join`n
Dim voic
Dim intValue

Set voic = WScript.CreateObject("SAPI.SpVoice")
Set voic.voice = voic.GetVoices("", "Language=809").Item(0)
voic.Speak("%intValue%")
Set voic = nothing
)

IfExist, %VBSScript%
FileDelete, %VBSScript%
FileAppend, %VBSfile%, %VBSScript%
RunWait, cscript.exe //nologo %VBSScript%,,Hide
FileDelete, %VBSScript%


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 18th, 2007, 8:18 am 
Offline

Joined: April 29th, 2006, 10:31 am
Posts: 29
Location: Sweden
engunneer wrote:
I was blind - the problem is obvious now that I see it

Code:
envget, tts, tts
name= this is a test

run, %tts% "%name%"


no Comma!, the comma made %name% the working directory, which is less useful.

I've tried all variations of comma placement, if I omit the comma after %tts% I get;

Code:
Error: Failed attempt to launch program or document:
Action: <c:\scripts\speak.vbs "his is a test">
Params: <>

The current thread will exit.

Specifically: The system cannot find the file specified.

   Line#
   001: EnvGet,tts,TTS
   002: name = "this is a test"
--->  004: Run,%tts% "%name%"
   005: Exit


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 18th, 2007, 8:23 am 
Offline

Joined: April 29th, 2006, 10:31 am
Posts: 29
Location: Sweden
Supercalifragilistic wrote:
m1m3r wrote:
What I would like to know is if there's any way to use a custom system variable something like this;

Code:
ExecuteSystemVariable, TTS "%name%"

Sorry I don't know the answer to that question. I hope that engunneer gave you the answer you was waiting for.
Just an other thing :
By doing like this (generate the VBS file from AHK and execute it), you haven't to transmit parameter :
Code:
VBSScript := "c:\scripts\speak.vbs"
intValue := "this is a test"

VBSfile =
(Join`n
Dim voic
Dim intValue

Set voic = WScript.CreateObject("SAPI.SpVoice")
Set voic.voice = voic.GetVoices("", "Language=809").Item(0)
voic.Speak("%intValue%")
Set voic = nothing
)

IfExist, %VBSScript%
FileDelete, %VBSScript%
FileAppend, %VBSfile%, %VBSScript%
RunWait, cscript.exe //nologo %VBSScript%,,Hide
FileDelete, %VBSScript%

Will try it later today.

I believe most Windows computers come with at least Microsoft Sam as speech synthesis so if you want you can make a VB script like mine and give it a try.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 7th, 2010, 5:22 pm 
Heya,
I have the following codeing in a .vbs file.

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Test.exe" & Chr(34), 0
Set WshShell = Nothing

Running this code excutes the test.exe hiding the promopt but without 3 paramters the exe fails. Normally this could be passed by a .bat or shortcut such as

Shortcut "C:\Test.exe" 10 1024 1024
Bat Start C:\Test.exe 10 1024 1024.

Could anyone tell me how i could put these 3 numbers into the vbs coding so my .exe will work.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Maestr0 and 62 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group