Yes, any ActiveScript language should have those three objects
predefined. How you access them may depend on the language. VBScript
has them defined, too; it's just that when we define them, we also ask
VBScript to define all of their members as well, so instead of writing
Application.Version you can just write Version.
Win32::OLE works just fine in internal scripts, too. It just doesn't
provide access to ClientInformation.
In regular Perl, in an external script, you would use Win32::OLE like
Steve did, but you'd need to call ClientIdentify so that Window-Eyes can
create and associate an appropriate ClientInformation object.
ClientIdentify doesn't do anything in internal scripts, because
Window-Eyes does different things when it starts up external scripts
than it does when it starts up internal ones.
Jamal Mazrui wrote:
Are such variables defined automatically for other Active Script
languages, e.g., Active Python? What if someone is coding in regular
Perl, will Win32::OLE work?
Jamal
On Mon, 23 Feb 2009, Ron
Parker wrote:
Date: Mon, 23 Feb 2009 11:07:19 -0500
From: Ron Parker <[email protected]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: Using PerlScript
A few notes:
- You should not need to use Win32::OLE if you're using ActiveState
PerlScript. When your script runs, it should already have three objects
defined in $Application, $Speech, and $Script. $Application is the one
you want to use wherever you're currently using $we.
- If you do create a new WindowEyes.Application object rather than using
the predefined $Application, you will indeed find that ClientInformation
is undefined. Use the Application object that's provided, and it'll be
hunky-dory.
- The second parameter to RegisterHotkey is the name - and only the name
- of the function or subroutine to be called; in this case that should
be "hello" rather than "hello()".