The GW-Scripting list is a discussion list for information regarding the development and use of Window-Eyes scripts. Any subscriber of the GW-Scripting list has the ability to post on-topic messages.
From:
martin websterSubject:
Re: afew questions about external scripts?Date:
Fri, Mar 19, 2010 3:26:30 pmHi Doug,
I indeed wanted to know the things I need to do to be able to run a script that is not hosted by window-eyes, but in a language simpler than C++, so I picked on VBScript unhosted by window-eyes so as I can better understand how to script in this way. I am currently playing around with a language called AUTOIT which is very simular to VBScript. Thanks for the example I like jeff will be adding this to my example directory.
Warm regards.
Martin Webster.
--- On Fri, 3/19/10, Doug Geoffray wrote:
From: Doug Geoffray
Subject: Re: afew questions about external scripts?
To: gw-scripting@gwmicro.com
Date: Friday, March 19, 2010, 6:03 PM
Martin,
Maybe I need to back up. If you just create a VBScript and associate
it to Window-Eyes and let Window-Eye launch it then you don't need to
deal with all the hassles you've been asking for help on. When
Window-Eyes launches an embedded active script, such as VBScript and
others, then you don't need to get an application object, you don't
need a process ID to register with ClientInformation, etc. Many things
are just handed to you for free. In fact, as you noted, you don't need
the GetRef command when it is an embedded script. So for example if
you create the script to be embedded as a VBScript (which I don't see
in your case why you would consider anything else) the sample script I
gave you would look more like this:
set hk = Keyboard.RegisterHotkey("control-shift-c", "SpeakIt")
Sub SpeakIt()
Speak "hello world"
Speak "all done, thanks for playing"
StopScript
End Sub
See how much similar this one is? This is because it is an embedded
script launched by Window-Eyes and because of that Window-Eyes gives
the script several things on a silver platter for free. The other was
assuming it got launched by somebody other then Window-Eyes. In that
case you have to get all the things on the silver platter yourself.
Then the third type (which I won't talk about here) is when Window-Eyes
launches a non-embedded script.
Now to specifically answer your GetRef question, this is a VBScript
command to get the address of the function supplied as a string. You
don't need this with an embedded script because Window-Eyes knows more
and does it for you automatically.
And regarding the process ID, you ONLY need this if Window-Eyes
launches your script and it is NOT an embedded active script. VBScript
is an active script so you do not need this. So unless you can tell me
why you feel you can't use VBScript as an embedded script I say don't
worry about the process ID.
Doug
martin webster wrote:
Hi all,
Thanks to everybody who replied. Doug can you explain the GetRef part of the hotkey declaration?.
set hk = wo.Keyboard.RegisterHotkey("control-shift-c", GetRef("SpeakIt"))
About the process ID I thought that I needed this parameter to identify the outside script to window-eyes and so that I can cleanly shut down the script with the script manager.
Thanks again for all the help.
Warm regards.
Martin Webster.
--- On Fri, 3/19/10, Doug Geoffray wrote:
From: Doug Geoffray
Subject: Re: afew questions about external scripts?
To: gw-scripting@gwmicro.com
Date: Friday, March 19, 2010, 2:30 PM
Martin,
Here is a simple example of a VBScript that runs externally
from Window-Eyes (runs with Windows scripting host) yet
still registers a hotkey. It simply registers
control-shift-c and when pressed it speaks "hello world" and
then the script exists.
allDone = False
Set wo = CreateObject("WindowEyes.Application")
set hk = wo.Keyboard.RegisterHotkey("control-shift-c",
GetRef("SpeakIt"))
While Not allDone
wscript.Sleep 100
Wend
wo.Speech.Speak "all done, thanks for playing"
Sub SpeakIt()
wo.Speech.Speak "hello world"
allDone = True
End Sub
as for you wanting a process ID, you can not do this from
VBScript but I'm wondering why you think you would need this
if Window-Eyes itself is not launching your VBScript.
You only need this if Window-Eyes launches your script as an
external script.
Regards,
Doug
martin webster wrote:
Hi all,
How do I create a hotkey in this stand alone version
of the helloWorld script included below, I just want this
script to run in the WSH environment and I can't seem to
create the hotkey (Shift-Control-C)?. Second How do I get
the script's process ID on the fly?.
Begin VBScript:
Dim myKey
set WE = createObject ("windoweyes.application")
Set myKey = createObject ("Keyboard.Keys")(vk_c)
myKey.RequireModifiers kmControl Or kmShift
WScript.ConnectObject myKey, "helloWorld"
Sub helloWorld()
WE.speech.speak "hello world"
End Sub
Warm regards.
Martin Webster
I indeed wanted to know the things I need to do to be able to run a script that is not hosted by window-eyes, but in a language simpler than C++, so I picked on VBScript unhosted by window-eyes so as I can better understand how to script in this way. I am currently playing around with a language called AUTOIT which is very simular to VBScript. Thanks for the example I like jeff will be adding this to my example directory.
Warm regards.
Martin Webster.
--- On Fri, 3/19/10, Doug Geoffray wrote:
From: Doug Geoffray
Subject: Re: afew questions about external scripts?
To: gw-scripting@gwmicro.com
Date: Friday, March 19, 2010, 6:03 PM
Martin,
Maybe I need to back up. If you just create a VBScript and associate
it to Window-Eyes and let Window-Eye launch it then you don't need to
deal with all the hassles you've been asking for help on. When
Window-Eyes launches an embedded active script, such as VBScript and
others, then you don't need to get an application object, you don't
need a process ID to register with ClientInformation, etc. Many things
are just handed to you for free. In fact, as you noted, you don't need
the GetRef command when it is an embedded script. So for example if
you create the script to be embedded as a VBScript (which I don't see
in your case why you would consider anything else) the sample script I
gave you would look more like this:
set hk = Keyboard.RegisterHotkey("control-shift-c", "SpeakIt")
Sub SpeakIt()
Speak "hello world"
Speak "all done, thanks for playing"
StopScript
End Sub
See how much similar this one is? This is because it is an embedded
script launched by Window-Eyes and because of that Window-Eyes gives
the script several things on a silver platter for free. The other was
assuming it got launched by somebody other then Window-Eyes. In that
case you have to get all the things on the silver platter yourself.
Then the third type (which I won't talk about here) is when Window-Eyes
launches a non-embedded script.
Now to specifically answer your GetRef question, this is a VBScript
command to get the address of the function supplied as a string. You
don't need this with an embedded script because Window-Eyes knows more
and does it for you automatically.
And regarding the process ID, you ONLY need this if Window-Eyes
launches your script and it is NOT an embedded active script. VBScript
is an active script so you do not need this. So unless you can tell me
why you feel you can't use VBScript as an embedded script I say don't
worry about the process ID.
Doug
martin webster wrote:
Hi all,
Thanks to everybody who replied. Doug can you explain the GetRef part of the hotkey declaration?.
set hk = wo.Keyboard.RegisterHotkey("control-shift-c", GetRef("SpeakIt"))
About the process ID I thought that I needed this parameter to identify the outside script to window-eyes and so that I can cleanly shut down the script with the script manager.
Thanks again for all the help.
Warm regards.
Martin Webster.
--- On Fri, 3/19/10, Doug Geoffray wrote:
From: Doug Geoffray
Subject: Re: afew questions about external scripts?
To: gw-scripting@gwmicro.com
Date: Friday, March 19, 2010, 2:30 PM
Martin,
Here is a simple example of a VBScript that runs externally
from Window-Eyes (runs with Windows scripting host) yet
still registers a hotkey. It simply registers
control-shift-c and when pressed it speaks "hello world" and
then the script exists.
allDone = False
Set wo = CreateObject("WindowEyes.Application")
set hk = wo.Keyboard.RegisterHotkey("control-shift-c",
GetRef("SpeakIt"))
While Not allDone
wscript.Sleep 100
Wend
wo.Speech.Speak "all done, thanks for playing"
Sub SpeakIt()
wo.Speech.Speak "hello world"
allDone = True
End Sub
as for you wanting a process ID, you can not do this from
VBScript but I'm wondering why you think you would need this
if Window-Eyes itself is not launching your VBScript.
You only need this if Window-Eyes launches your script as an
external script.
Regards,
Doug
martin webster wrote:
Hi all,
How do I create a hotkey in this stand alone version
of the helloWorld script included below, I just want this
script to run in the WSH environment and I can't seem to
create the hotkey (Shift-Control-C)?. Second How do I get
the script's process ID on the fly?.
Begin VBScript:
Dim myKey
set WE = createObject ("windoweyes.application")
Set myKey = createObject ("Keyboard.Keys")(vk_c)
myKey.RequireModifiers kmControl Or kmShift
WScript.ConnectObject myKey, "helloWorld"
Sub helloWorld()
WE.speech.speak "hello world"
End Sub
Warm regards.
Martin Webster




