Stuart,

Rod is right about the Script object. But that's because it's specific to scripts hosted by Window-Eyes. The Application object is the doorway for external scripts. It also is for hosted scripts. But this has all been taken care of up front so folks writing hosted scripts don't have to deal with it.

Unless there is a real reason you need to use VB you're actually better off using VBScript. Yes, it's an interpreted language. But it's hosted by Window-Eyes and therefore is handled in process by Window-Eyes. Conversely, a VB script will run out of process. So there will be a lot of inter-process communication that will slow things down significantly. The only time compiled VB will increase performance is if you need to do serious computational crunching. And the only other reason to use VB is if you need access to things such as API calls that VBScript can't give you. And finally, when writing an external script you have to do a lot of work that has already been done for us when writing hosted scripts.

The problem with events is that event handlers MUST support IDispatch. Window-Eyes won't call the vTable interface for them. So you can't use early binding or direct access, which is another performance hit. Things must be constructed on the fly (late binding) rather than pre-compiled from the COM interface.

Hth,
Tom


On 3/3/2017 7:55 PM, Rod Hutton via Scripting wrote:
Hi Stuart,

I copied this excerpt from the information panel of the main Script node in the 
App Developer's manual and this explains your situation:


Script properties, methods, and events are only available for scripts hosted 
under Window-Eyes. External, un-hosted scripts will not have access to any of 
the Script object properties, methods, or events.

I would add that the same seems to be true for the Keyboard object.

However, the fact that this is true implies that there are alternative means of 
gathering the information you require.

I hope this helps,

Rod

-----Original Message-----
From: Scripting 
[mailto:scripting-bounces+rod_hutton=hotmail....@lists.window-eyes.com] On 
Behalf Of Stuart Foster via Scripting
Sent: Friday, March 3, 2017 6:13 AM
To: scripting@lists.window-eyes.com
Subject: Accessing events from external code

Hi



I've been trying to write code that accesses the Window-eyes com Automation
object model from Visual Studio and Powershell. These do not run under the
Window-eyes environment. I have been able to instantiate the Windoweyes
Object Model, and access the objects' properties and methods. But I cannot
access the events. Both PowerShell and the Visual Studio compiler report
that the event I am accessing does not exist for the object. Here is what I
have done, in both PowerShell and a Visual Studio VB module:



Instantiate the Object Model - success

Set up a local variable object for the Windoeyes Keyboard - success

Demonstrated that I can test the keyboard.KeyDescriberActive state by
outputting a variable giving the Boolean value - success

Run the application.onquit method to close Window-eyes - success

Used the application,speech.speak method to speak out strings - success

Attempted to access the keyboard.OnKeyProcessedUp and OnKeyUp events. In
both environments, the compiler and interpreter report that the event does
not exist for the object.



Any ideas? Any help much appreciated.



With thanks



Regards

Stuart Foster

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com/attachments/20170303/caabf8b0/attachment.htm>
_______________________________________________
Any views or opinions presented in this email are solely those of the author 
and do not necessarily represent those of Ai Squared.

For membership options, visit 
http://lists.window-eyes.com/options.cgi/scripting-window-eyes.com/rod_hutton%40hotmail.com.
For subscription options, visit 
http://lists.window-eyes.com/listinfo.cgi/scripting-window-eyes.com
List archives can be found at 
http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com
_______________________________________________
Any views or opinions presented in this email are solely those of the author 
and do not necessarily represent those of Ai Squared.

For membership options, visit 
http://lists.window-eyes.com/options.cgi/scripting-window-eyes.com/tom.kingston%40charter.net.
For subscription options, visit 
http://lists.window-eyes.com/listinfo.cgi/scripting-window-eyes.com
List archives can be found at 
http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com

_______________________________________________
Any views or opinions presented in this email are solely those of the author 
and do not necessarily represent those of Ai Squared.

For membership options, visit 
http://lists.window-eyes.com/options.cgi/scripting-window-eyes.com/archive%40mail-archive.com.
For subscription options, visit 
http://lists.window-eyes.com/listinfo.cgi/scripting-window-eyes.com
List archives can be found at 
http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com

Reply via email to