Hi Ralf,
Try this, I'm not sure if this is what you want, but this snippet will execute 
the hotkey insert "t", the time and date window-eyes hotkey running as an 
external app written in VBScript. Just press enter on what ever you decide to 
call the snippet and it should run. you need window-eyes 7.5 to run this though.
begin snippet:
Set we = CreateObject("WindowEyes.Application")
set MyHotkey = we.Keyboard.Key("Insert-t")
wscript.Sleep 2000
MyHotkey.Insert()
wscript.Sleep 1000
we.Speech.Speak "all done exiting script"

Hope this helps.
Warm regards.
Martin Webster.
I.T. team leader for Kirklees visual impairment network.


--- On Mon, 5/21/12, Ralf Kefferpuetz <[email protected]> wrote:

> From: Ralf Kefferpuetz <[email protected]>
> Subject: RE: calling WE functions or hotkeys from an external program
> To: [email protected]
> Date: Monday, May 21, 2012, 4:04 PM
> Hello Bruce,
> 
> many thanks for that. Let me make myself a bit more clear.
> What I want to
> achieve is the following:
> 1) I have WE apps running with hotkeys assigned to their
> functions, which is
> a normal app hotkey behavior. The user can execute these
> functions by
> pressing the defined hot key.
> 2) now I want to execute this functions from an external
> program either by
> firing the hotkey or by calling the global function in the
> app
> In your example you are using the version method, which
> comes directly from
> the WE object, but how to execute an app defined hotkey or
> global function?
> Here is a small example, see this tiny app:
> Set myHotkey = Keyboard.RegisterHotkey("Control-f12",
> "InsertDate")
> function InsertDate()
>     Keyboard.InsertString Time & " on " &
> FormatDateTime(Date,1) 
> End function
> Now, is it possible to fire the Control-F12 hotkey or the
> function
> InsertDate() from within a program?
> I'm not sure if I could make it a bit more clear.
> 
> Regards,
>   Ralf
> 
> Ralf Heinrich Kefferpuetz
> Web: http://www.keffi.eu
> Facebook: http://www.facebook.com/Keffi.eu
> Germany
> 
> -----Original Message-----
> From: BT [mailto:[email protected]] 
> Sent: Monday, May 21, 2012 4:12 PM
> To: [email protected]
> Subject: Re: calling WE functions or hotkeys from an
> external program
> 
> 
> Hi Ralf,
> 
>     Just use the create object from your calling
> app in the format such as 
> below. This is the python comtypes call and what ever you
> use as your com 
> types method is the format you must use.
>     Note the individual method is after the first
> period.
> 
> WeTts = CreateObject( "windoweyes.application")
> weVersion = WeTts.Version
> WeTts.Speech.Speak (" The version of we is: %s" %
> weVersion)
> 
> Sent: Monday, May 21, 2012 4:10 AM
> Subject: calling WE functions or hotkeys from an external
> program
> 
> 
> Hi all,
> 
> I'm looking for a way to call hotkeys, or functions, from WE
> apps in an
> external program.
> An example for reading the active window would be:
> WindowEyes.Application.ExecuteHotkey(130)
> So, can an app register an unique hotkey ID?
> Are there other ways to access an function in a public
> running app?
> 
> Many thanks for your ideas,
>   Ralf
> 
> Ralf Heinrich Kefferpuetz
> Web: http://www.keffi.eu
> Facebook: http://www.facebook.com/Keffi.eu
> Germany
> 
> 
>

Reply via email to