Macro Expert » Building a macro script by recording the mouse and keyboard actions

Building a macro script by recording the mouse and keyboard actions

In Macro Expert, all the tasks have been performed automatically based on the macro scripts. A macro script includes all the steps for performing a task, for example, removing the mouse, clicking the mouse and searching an image on the screen, etc. The most easy way for building a macro script is to record the operation actions directly (namely the operations of the mouse and keyboard). The following is the details for building a macro script by recording way and some skills for building a macro script.

Record a macro

Recording the mouse and keyboard operations are the functions of Macro Manager, so you can use this way to build a macro script. First, you run Macro Manager by double clicking the icon on the desktop. If it has already run, you can see it at the lower right corner on the screen and click the icon to open Macro Manager Window. Like the image below:

  1. Close all the windows that are not relative with this task in case the process of the recording affects other windows or programs.

  2. Open Macro Manager and switch to the tab "Macros".

  3. Click "Record a Macro" on the left common tasks pane or the button "New macro" on the toolbar. Like the image below:


  4. Now, you can follow the guild to build a new macro. First, you will fill a name and description for the new macro, like "Email" or "Print invoice", etc. Also you can choose a name you like. This is optional parameter that explains the function of this macro. You may leave it blank, but it is recommenced to fill a name and description for you can be convenience to know what the macro had done after a long time. After finished, click the "Next" button.

  5. Second, you would set the parameter "Default repeat times for playing this macro", namely how many times this macro can be replayed. Meanwhile you can set the "initial play speed" for this macro. The scope is from -10 to 10. -10 is the most slow and 10 is the most fast. 0 is the normal speed- that is the speed for recording the macro. On this page, you can choose a hotkey for this macro. The hotkey can be a combination of keys, or some words. It is important to remember Macro Service is in change of the hotkeys. That is if the hotkeys want to be run well, Macro Service must be run first. If you set a hotkey for several macros, all these macros will be run when you press the hotkey.

    After finished these steps setting, click the "Next" button.

  6. And now you can see the last one page about "Recording Scope". In Macro Expert, you can specify the recording scope including the keyboard keystrokes, the mouse activities or both. By default, the recording scope includes both of the mouse and keyboard activities. You can choose what you need. If you want the replay speed to play back faster, don't tick the options "Save time interval between two keystrokes" and "Record mouse movements".

    In this page there is an important option "Mouse position is relative to". This option will affect the X and Y coordinates of the mouse created by the macro. There are three conditions:

    • Screen coordinates

      This model meets most of case needs. When you choose this option, the coordinate position of the mouse (X and Y) is calculated base on the top left corner of the screen. If you choose this one, the mouse in the window can not click the correct position because the window position changes when replaying.

    • Foreground window

      When chose this model, Macro Expert will record the mouse position based on the top left corner of the foreground window, namely the mouse is located on the window, and don't record the size of the screen or the position of the window on the screen. When replaying, the Macro Player will check which window is foreground, and put the mouse in the right position on this window. The mouse can click the right position even though the screen is changed or the location of the window is changed.

    • Previous cursor position

      This model meets the drawing needs, or some cases that are calculated according the latest mouse position. On the model, Macro Expert will record the difference in coordinates between the two times, and don't care about the sizes and the position of the screen and the window. For example, if you need to click several links on a website, and know that each only has 50 pixels wide, so you would use the "Screen coordinate" or the "Foreground window" to click the first link, and then use the "Previous cursor position" to click all the leave behind links. Like below:

      • Clicks the left mouse button at coordinates X: 200, Y: 100 (based on the coordinate relative on the window)
      • Clicks the left mouse button at coordinates X: 50, Y: 0 (based on the coordinate relative on the previous cursor position), but in fact the left mouse button will click at coordinates X: 250, Y: 200.
      • Clicks the left mouse button at coordinates X: 50, Y: 0 (based on the coordinate relative on the previous cursor position), but in fact the left mouse button will click at coordinates X: 300, Y: 200.
      • ...

    If you choose the model "Foreground window", you would tick the option "Smart mode", because Macro Recorder will convert the changes of the window (open a new window, adjust the size, etc) into a window action built-in the macro script while recording. So when replaying, the mouse will click at the right position.

    In this page, there is an option "Switch to window before recording". This means Macro Recorder will automatically switch to the window which you want to operate before recording. Later, Macro Expert can not record these unnecessary window switching actions that affects the macro running well when replaying.

    Now, click the "Ok" button to begin recording.

  7. A countdown window will pop up while you can put the mouse into the starting position for ready recording. After recording, you click the stop button on the screen or press the stop key. Now the macro script will appear in Macro Manager.


Play the recorded script.

Recorded script is now in Macro Manager. Like the image below. There are two ways to play it.

  1. Replay the script in Macro Manager, you just click the recorded macro, and click the button "Play" on the toolbar. There are two ways to play the macro. One is "play" and the other one is "quick play". Quick play will start to play directly, and use the default playback parameters. If you choose "Play", you can change the playback parameters in the play dialog, like the initial speed, the playback times, etc.

  2. Replay the script by using the hotkey. If you have set a hotkey for this macro, you can just press the key to play it easily.

Conclusion:

It is simple to use the recording/playing mode to build a macro script. For some simple tasks, in this way the process of building a macro script is the most convenience. But also you can see that this ways of building a macro script don't have the intelligent judgment ability because this ways is based on the mouse and keyboard actions. If these tasks have not been performed by the mouse and keyboard, you can not use this way to build a macro script, and also the computer can't do other works when replaying a macro because it must use the mouse and keyboard simulation. Moreover, some games or software keep from the mouse and keyboard simulation for the purpose of safe or anti plug so that the recorded script can't click or fill the characters on the right position when these programs run.

In order to have the intelligent judgment ability and not to occupy too much the mouse and keyboard and have full-function macro scripts, there is another way to build a macro script through Macro Editor. Actually, most functions have been performed by using Macro Editor, for example, sending Email, operating the webpage, operating the file and database, etc.