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:
making my unhosted VBScript known to the script manager?Date:
Mon, Mar 22, 2010 8:04:22 amHi all,
How do I get my unhosted VBScript to show up in the script manager?. According to the docs I should use the ClientIdentify method of the Application Object inconjunction with ClientInformation but I don't seem to be getting it right. Below is Doug's example script he left us with on friday only I wrote a function using win32 process wish does give me the Script's PID but when I give this to the ClientIdentify method nothing shows up in the script manager still. I know that it is giving the correct information because if you remove the "'" from the three lines with in the function you get full path name of where the script was run from and Object name (the object process that started the script).. Please help.
Begin VBScript
Dim MyHotKey, keyFlag, PID
keyFlag = False
Set WE = CreateObject("WindowEyes.Application")
WE.ClientIdentify(GetProcessId("wscript.exe"))
PID = GetProcessId("wscript.exe")
WE.Speech.Speak "this is the process ID" & " " & PID
set MyHotKey = WE.Keyboard.RegisterHotkey("control-shift-c", GetRef("helloWorld"))
While Not keyFlag
wscript.Sleep 100
Wend
WE.Speech.Speak "all done, thanks for playing"
Sub helloWorld()
WE.Speech.Speak "hello world"
keyFlag = True
End Sub
Function GetProcessId(scriptObject)
Set objSWbemServices = GetObject ("WinMgmts:RootCimv2")
Set colProcess = objSWbemServices.ExecQuery _
("Select * From Win32_Process")
For Each objProcess In colProcess
If InStr (objProcess.CommandLine, WScript.ScriptName) 0 And objProcess.Name = scriptObject Then
GetProcessId = objProcess.ProcessId
' WScript.Echo "object name" & " " & objProcess.Name, _
' "process Id" & " " & objProcess.ProcessId, _'
' "full path and file name" & " " & objProcess.CommandLine
End If
Next
End Function
How do I get my unhosted VBScript to show up in the script manager?. According to the docs I should use the ClientIdentify method of the Application Object inconjunction with ClientInformation but I don't seem to be getting it right. Below is Doug's example script he left us with on friday only I wrote a function using win32 process wish does give me the Script's PID but when I give this to the ClientIdentify method nothing shows up in the script manager still. I know that it is giving the correct information because if you remove the "'" from the three lines with in the function you get full path name of where the script was run from and Object name (the object process that started the script).. Please help.
Begin VBScript
Dim MyHotKey, keyFlag, PID
keyFlag = False
Set WE = CreateObject("WindowEyes.Application")
WE.ClientIdentify(GetProcessId("wscript.exe"))
PID = GetProcessId("wscript.exe")
WE.Speech.Speak "this is the process ID" & " " & PID
set MyHotKey = WE.Keyboard.RegisterHotkey("control-shift-c", GetRef("helloWorld"))
While Not keyFlag
wscript.Sleep 100
Wend
WE.Speech.Speak "all done, thanks for playing"
Sub helloWorld()
WE.Speech.Speak "hello world"
keyFlag = True
End Sub
Function GetProcessId(scriptObject)
Set objSWbemServices = GetObject ("WinMgmts:RootCimv2")
Set colProcess = objSWbemServices.ExecQuery _
("Select * From Win32_Process")
For Each objProcess In colProcess
If InStr (objProcess.CommandLine, WScript.ScriptName) 0 And objProcess.Name = scriptObject Then
GetProcessId = objProcess.ProcessId
' WScript.Echo "object name" & " " & objProcess.Name, _
' "process Id" & " " & objProcess.ProcessId, _'
' "full path and file name" & " " & objProcess.CommandLine
End If
Next
End Function




