Move Mouse Action Icon

Move Mouse

Declaration

<AMMOUSEMOVE MOVEX="number" MOVEY="number" RELATIVETO="text(options)" DELAY="number" />

See Also

Check | Click Mouse | Get Selected List Item | Get Selected Tree Item | Get Text | Hold Down Key | Move Mouse to Object | Press | Release Key | Select Item | Select List Item | Select Tree Item | Send Keystrokes | Set Text

Description

Moves the mouse pointer to the specified pixel coordinates. To capture X/Y coordinates, move the cursor to the desired area on the screen and press the INSERT key.

IMPORTANT: Because it uses pixel coordinates instead of control locations, this action is only recommended for use if an application cannot be automated using the Move Mouse to Object action, Send Keystrokes action or other, more reliable Interactivity actions. This would usually only occur if the external application that is being automated did not contain standard Windows controls or did not support standard Windows conventions such as accelerator keys or hot-keys. The reason for this is that mouse movements and clicks are dependant on window positioning and screen resolution, whereas the Send Keystrokes action is not affected by this variable and the Move Mouse to Object action communicates with the target control natively.

Practical Usage

Commonly used to move the mouse cursor to an X/Y pixel coordinate on the screen and normally followed by a Click Mouse action.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

X Pos

Number

Yes

(Empty)

MOVEX="288"

The X pixel coordinate that the mouse pointer should be moved to. To capture X/Y coordinates, move the cursor to the desired area on the screen and press the INSERT key.

Y Pos

Number

Yes

(Empty)

MOVEY="216"

The Y pixel coordinate that the mouse pointer should be moved to. To capture X/Y coordinates, move the cursor to the desired area on the screen and press the INSERT key.

Relative To

Text (options)

No

Relative to foreground window

RELATIVETO="window"

The point of reference the specified coordinates are relative to. The available options are:

  • Relative to foreground window (default): Coordinates are relative to the upper-left hand corner of the window that is currently focused when the step executes.

  • Relative to screen: Coordinates are relative to the upper-left hand of the screen.

  • Relative to current position: Coordinates are relative to the position of the mouse cursor when the step executes.

Advanced Properties

Property

Type

Req'd

Default

Markup

Description

Add a pause after moving the mouse

Number

No

(Empty)

DELAY="2000"

The amount of milliseconds to pause after the mouse cursor is moved to the specified coordinates. Adding a delay might make this action more reliable in certain situations.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: This sample task shows use of the Move Mouse action.

 

<AMBROWSER URL="https://www.networkautomation.com/downloads/" />

<AMWINDOWMAXIMIZE WINDOWTITLE="Download AutoMate - Network Automation - Windows Internet Explorer" />

<AMPAUSE ACTION="waitfor" SCALAR="2" />

<AMMOUSEMOVE MOVEX="879" MOVEY="659" RELATIVETO="screen" DELAY="2000" />

<AMMOUSECLICK />

 

↑ Top of Page