Mouse Commands


Performs a mouse action at the specified coordinates.

For most mouse movement actions, the following option is available:

*Tip:  Keyboard commands are more reliable than mouse clicks, so use them instead of mouse commands when possible.


The available commands are:

  Mouse Click
  Move
  Move to Window
  Move to Image
  Click on Image
  Save Current Position
  Return to Saved Position


  Mouse Click
 


All mouse button commands are combined into this single action. You can combine two separate commands: which button, and press/release.

*Tip:  For a normal mouse click, choose the options "Left" and "Down+Up".

OptionDescriptionUseful For
Button: Left Performs the operation using the left mouse button Clicking on items
Button: Right Performs the operation using the right mouse button Displaying a context menu
Button: Middle Presses and holds the middle mouse button
(sometimes this is the middle scroll wheel)
Displaying the "Scroller" in web browsers
Button: Wheel Scroll Rolls the scroll wheel forward or backward Scrolling in a web browser,
or zooming in other applications
 
Press Type: Down Presses and holds a mouse button Beginning a drag operation
Press Type: Up Releases a mouse button Ending a drag operation
Press Type: Down+Up Presses and then releases a mouse button A normal click
Press Type: Double-Click Quickly Presses and releases a mouse button twice Performing a double-click to activate items;
only used for the Left mouse button


*Tip:  Here's an example of how to do dragging:




  Move
 

Repositions the mouse cursor to a new location on the screen. The movement is based on the following actions:

*Tip:  The (X,Y) setting can contain embedded calculations. This allows easy position increments for each mouse movement. For example, the first coordinate can be (10,10), the second at (10,10+20), the third at (10,10+40), etc. This is especially useful with variables:  (%x+10, %y-20)

Under normal circumstances, an equals sign must precede a formula calculation.


  Move to Window
 

Repositions the mouse cursor to the middle of the currently active window or control. The window must have been previously found by using the Use Window action.

For more information concerning locating windows and controls, see Identifying Windows and Controls.


  Move to Image
 

In addition to moving to window and screen coordinates, you can also move to an image on the screen. This is useful for clicking on icons or on web page links that may move to different coordinates each time. For example, many web link images relocate depending on the size of the browser window. This option ensures that the mouse will always click on the right spot, and is the preferred way to automate web pages. The image must be visible on the screen at the time the mouse command is run, otherwise the step will fail.

For more information, see the Using Images section.


  Click on Image
 

The identification of the image uses the same method as the Move to Image action. The mouse click will occur at the middle of the image's rectangle.

For more information, see the Using Images section.


  Save Current Position
 

Stores the current position of the mouse. This allows you to later return to the same position with the Return to Saved Position action after other mouse movements take place.

Place at the beginning of your script to ensure the mouse returns to where it was before the script was run.


  Return to Saved Position
 

Returns the mouse cursor to the previously stored position that was saved with the Save Current Position action.

Place at the end of your script to ensure the mouse returns to the location it was before the script was run.