Hi Again Chip: That's what I thought of Power Shell as well - really, really
cryptic.Anyway, I can't get VB.net script to work today so until later...
Rick USA
----- Original Message -----
From: Chip Orange
To: [email protected]
Sent: Sunday, April 17, 2011 12:48 PM
Subject: external apps and WE events
Hi Rick,
I'm sure any language will work just fine for app development. There is this
work-around necessary for use of MSAA (only) at the moment, but it's only a
couple of lines.
I have a prejudice for straight-forward procedural languages, and really
dislike power shell for this reason. If nothing else, I think it's going to be
very difficult for one person to write something, and find another who can just
pick it up and maintain it. I spent a great deal of time getting anything to
work in it, no matter what it was. If you're the kind who likes to play with
secret decoder rings, well, you'll love powerShell.
Anyway, you should be fine in developing in VS (maybe 2008 though, I'm not
sure how 2010 is doing). And I really doubt there's any significant
performance hit for managed code. I believe you do need to do something
(perhaps involving use of interop assemblies?) in order to properly interface
with non-managed apps such as WE, but I'd guess you had figured that much out
by now.
The only thing I did to get my VBScript working was to connect to the
associated object type in order to use it's events, just like we would do in
hosted VBScript apps. don't know why I thought I'd do it all through the
application object, I guess because that's how I was doing it with Word, but it
happened all the events for Word I'm using are application object events, so it
probably lead my down the garden path.
For anyone who is interested, the short WSH VBScript is below:
' demonstrates use of the WE object model and it's events from an external
WSH VBScript
set we = createObject("WindowEyes.application")
we.speech.speak "WE is now connected."
'set d=we.desktopWindow
wScript.connectObject we.desktopWindow, "d_"
we.speech.speak "events all hooked up."
s=inputbox("press ok to terminate test")
set d=nothing
set we=nothing
sub d_onChildActivate(win)
we.speech.speak win.title & " became active"
end sub
------------------------------------------------------------------------------
From: RicksPlace [mailto:[email protected]]
Sent: Sunday, April 17, 2011 5:46 AM
To: [email protected]
Subject: Re: A little description of what to use AttachWindowMessage for
Hi Chip: : First, congratulations on being the first Programmer, at least I
have heard of, outside GW to get a MSAA and, or, Window Events external script
to work! Jamal had tgotten his Fruit Basket app working but it lacked some key
operations considering the nature of a WindowEyes Script which would normally
be attached to another App like Notepad or Visual Studio or Microsoft Offece
etc...
I will examine the GW sample to see what they did diferently and implement
any necessary changes. I am a little frustrated about the fact it did not run
out of the box but Aaron had said it was their development version so I didn't
expect anything except just enough to see how they handled events that worked
during testing. Save your external scripts and I will either give you code to
run some performance tests or use your scripts to run some tests. I am just
wondering which language, if any, has any real potential beyond VBScript for
Professional scriptors.
The new Power Script idea is interesting but the language is pretty cryptic
and accessing some of the .net classes pretty verbose.
That said, it is interesting because I think it runs under "Unmanaged Code"
and not under the "Managed Code" environment which might mean better
performance than a Visual Studio type project which runs under the "Managed
Code" environment.
I would like to have the massive power of a true ide like Visual Studio.
Rick USA
yo
----- Original Message -----
From: Chip Orange
To: [email protected]
Sent: Sunday, April 17, 2011 12:09 AM
Subject: RE: A little description of what to use AttachWindowMessage for
Sorry GW and Rick,
I got this to work in external VBScript, so now I'm just left thinking
about my VBA example, but obviously external apps do get events from the WE
object model.
This is one instance where late-night programming caused me to get it
right, instead of screwing it all up (like I did in the afternoon today).
Rick, I see the VB code from GW has each object you may possibly want
events for, being declared (with events) and stored in it's own variable, and
the handlers set to handle events from each of these individual objects rather
than trying to do everything off of the main application object. I suspect
this is the key to why your first attempt wasn't working correctly, from what I
remember seeing of your code. (but I am someone who hasn't used VB ...)
Chip
----------------------------------------------------------------------------
From: Chip Orange [mailto:[email protected]]
Sent: Saturday, April 16, 2011 11:22 PM
To: [email protected]
Subject: RE: A little description of what to use AttachWindowMessage for
thanks Rick.
I'm not being an external script being run by WE though, I'm actually an
external application using the WE object model, and so I shouldn't have to use
clientIdentify, but I should be able to have events work (I followed an example
from MS showing how they used VBScript to access Word's object model, and have
it fire event handlers in the VBScript code).
Chip
----------------------------------------------------------------------------
From: RicksPlace [mailto:[email protected]]
Sent: Saturday, April 16, 2011 8:20 PM
To: [email protected]
Subject: Re: A little description of what to use AttachWindowMessage for
Hi Chip: I downloaded the new VB.net External script from GW. I had to load
up VB.net 2010 Express and set it up with 7.5 and get the settings so WE would
work well enough to get started looking at it. It seems to be all there and
there seems to be a couple of interesting things that are a little diferent, I
think, from my code. I did try and run it but the run failed. A WindowEyes
message that ClientIdentify needed to be run at line xxxx I don't have time to
look into it yet but will tomorrow or Monday if I can.
Anyway, I have the complete puppy that should work and I will let you know
what I find.
Later Chip and see you Sunday.
Rick USA
----- Original Message -----
From: Chip Orange
To: [email protected]
Sent: Saturday, April 16, 2011 4:41 PM
Subject: RE: A little description of what to use AttachWindowMessage for
Hi Rick and GW,
I have to agree with Rick: I wrote an external script in VBA, and I too
could not get any of the events I tested with to fire at all (things like
onActivate and onChildActivate). even when I setup onChildActivate on the
desktopWindow object, which should have been firing every time I changed
windows, weren't firing.
wanting to be sure it wasn't my VBA environment, I then did the same
thing using an external VBScript program running under WSH. no joy with it
either.
Chip
--------------------------------------------------------------------------
From: RicksPlace [mailto:[email protected]]
Sent: Tuesday, April 12, 2011 10:38 AM
To: [email protected]
Subject: A little description of what to use AttachWindowMessage for
Hi: Since my VB.net External script is not processing Window Events -
actually it did once but never again through several tests it just wouldn't do
it again at all. I was wondering what the
AttachWindowMessage Method of the WE Application object is used for.It
sort of sounds like it might be a counterpart to the MSAA WatchEvents thingy
but I'm not sure. The syntax examples are in VBScript in the manual as far as I
can tell so I'm not sure this is for Hosted or External scripts and what it
actually does.
Thanks:
Rick USA