--- In [email protected], "brucexs" <[EMAIL PROTECTED]> wrote:

> So I implemented a win.sendmouse function which allows you to send
> mouse clicks using the same commands as *mouse, two letter version
> only.  It uses sendinput Windows function, which I understand may
> work in Vista.
>
> win.sendmouse("ab", x, y, "lc")  // move to x y then left click
>

That's great Bruce, thank you. Vista may yet be in my distant future.

I tried win.sendmouse (on XP). Don't know if you saw my previous odd
issue with mouse activity and focus
<http://tech.groups.yahoo.com/group/power-pro/message/32111>

I have the same issue when using win.sendmouse, except that with
win.sendmouse, I have the problem even when the script is file-based.
With win.mouse the issue occurred only when the script was stored in
the pcf.

The method by which the script is launched is also relevant. The
problem occurs only if the script is launched from a bar button. (Its
a caption button). The script btw includes a win.resetfocus.

Essentially the app getting clicked needs to be in control after the
mouse click. Its normal behavior is to open a new document (in its
tabbed document interface), then do some things to the new document.
Instead it opens the new document but focus stays on the old document.
So what should happen to the new document hits the old one instead.

Actually my script has two mouse actions: click at absolute
coordinates, and return the mouse pointer to original coordinates.
Then quit all.

In my sendmouse version, it looks like if I omit the return to the
original coordinates it works as it should. I tried adding waits of
various lengths before returning to the original coordinates, but that
was unreliable (sometimes the app's original document retained focus).
I can't wait until the click-induced document activity is complete,
because sometimes there are interactive components (and its strange if
the mouse is not where its expected to be).

Any suggestions? Would it be possible to have a single sendmouse_extra
command which captures the mouse position, clicks at another location,
then returns to the original position?

Regards,
Sheri

Reply via email to