Click at Random Screen Location from Macro Script

When you want to Click at a Random Screen Location, you can define a Rectangular Area in which the Mouse Click must be performed. Once you have added a Left Click to the Macro Script, you can edit it’s parameters to enable the Random Screen Location and define a Rectangular Area in which you want the Script to Click.

Click at Random Screen Location in a Rectangular Area

Click at Random Screen Location in a Rectangular Area

To get started, do add a Left Click to the Script with the help of Pick Button or with the help of Keyboard Shortcut. Yes you can optionally add a Left Click at any Screen Location as the actual X and Y Screen Co-ordinates will be changed in the next step. The Post Add Macro Action to the Script talks in detail about using the Pick Button and about the Keyboard Shortcut Method to pick Fixed Screen Location and add selected Action to the Macro Script. The given below procedure outlines the steps required to add a Left Click to the Script and then modify it’s parameters to effectively click at a Random Screen Location in Rectangular Area

  1. Add a Left Click (Screen Location is Irrelevant here) to the Script.
  2. Double Click on the Action in the Script Editor or use the E Button to bring up Edit Parameters Screen.
  3. Enable the Checkbox Random Location for Mouse Action.
  4. Click on … to view Information box as displayed in the Screenshot above.
  5. Review the Information provided and click on OK to dismiss the information box.
  6. Now use your Mouse to Drag around the Rectangular Area.
  7. Once you have Completed above Steps, Click on OK to close the Edit Parameters Screen.
  8. The Left Click is now Configured to Click at a Random Screen Location in the Rectangular Area. You can use the Select / View Area Button to reconfirm the Dimensions and Location of Rectangular area or repeat Step 6 above to Modify the Rectangular Area.

Once you have configured the Left Click Macro Action in the Script to do Left Mouse Click at a Random Screen Location in the defined Rectangular Area, the Script Editor will display the Bounding Rectangular Co-Ordinates as displayed in the Screenshot below. In case you wish to Modify the Dimensions or Location of Rectangular area, use the Edit Parameters Screen again.

Left Mouse Click at Random Screen Location in Rectangular Area visible in Script Editor

Left Mouse Click at Random Screen Location in Rectangular Area visible in Script Editor

As per above parameters for the Left Mouse Click in the Script, the bounding Rectangle will remain fixed, however the actual Screen Location will be decided at Run Time and will be a Random Location in the bounding Rectangular Area. You can even use Repeat Count to repeat the execution of the Left Click as configured above. Even when the Macro Action is executed multiple times, each time the actual location of Mouse Click will be decided dynamically and will be a Random Screen Location in the bounding Rectangular Area.

Random Mouse Clicking done by Macro Script in Rectangular Area with the help of Repeat Count

Random Mouse Clicking done by Macro Script in Rectangular Area with the help of Repeat Count

The above Screenshot displays a drawing in Microsoft Paintbrush created by a Macro Script configured to Click at Random Screen Location in a Rectangular Area. Note that the Script Repeat Count is set to 500 and the Script was executed a few times. Yes Paintbrush was configured earlier to draw a Line wherever Mouse Click is done. You can even specify Random Time Delay for the Left Click or any other Macro Action in the Script making it a Random Mouse Clicker kind of Script which will Click at Random Screen Location at Random Time Interval.