System.GetMousePosition

table System.GetMousePosition ( 

boolean ClientCoordinates = true,

number  WndHandle = nil )

Description

Returns a table containing the current position of the mouse, either relative to the entire screen (screen coordinates), relative to the application (client coordinates), or relative to some other client window.

Note: Screen coordinates are relative to the top left corner of the screen. Client coordinates are relative to the top left corner of the application's client area (the page), and if WndHandle is specified, it will be relative to the top left corner of that window.

Parameters

ClientCoordinates

(boolean) Whether to get the mouse position relative to the application or another window:

VALUE

DESCRIPTION

true

Return the current position of the mouse relative to the application (client coordinates) or some other window. (Default)

false

Return the current position of the mouse relative to the screen (screen coordinates).

WndHandle

(number) An optional numeric window handle of a window to get the relative mouse position of. This value will only be used if ClientCoordinates is set to true and a valid window handle is passed. If this value is nil the application's client area will be used.

Returns

(table) A table containing the current position of the mouse, either relative to the entire screen (screen coordinates), relative to the application (client coordinates), or to a specific window, indexed by the following keys:

KEY

TYPE

DESCRIPTION

X

number

The horizontal position of the mouse cursor.

Y

number

The vertical position of the mouse cursor.

If this information cannot be determined, or an error occurs, nil is returned. You can use Application.GetLastError to determine whether this action failed, and why.

ResultVariable

When adding an action with the script editor, you can use this field to specify a variable that the return value will be stored in.

See also:  Related Actions