If you want to improve your digital productivity, recognizing opportunities for automation is a crucial step. It’s an old maxim in programming that you should never do anything twice, and the same applies to productivity. Whenever you have to repeat the same action more than a couple times, you should think about how you can automate it. For example, if you have to execute the same mouse action over and over again and there’s no way to make the steps happen automatically, you can use software to record mouse activity in macOS. This way, you can step away from your computer while the macro runs, executing actions as if you were driving the cursor.
Before we begin, it’s important to realize that mouse recording is a little bit stupid. It neatly defines the “garbage in, garbage out” paradigm of programming and computing. It simply records and plays back a series of mouse actions; it’s too dumb to do anything else. It won’t know what window it’s clicking on, or even know if it’s just clicking on the Desktop over and over because the intended target window is closed. It doesn’t change based on context or window position, so simple things can cause it to fail.
For example, if you record a macro and then move a window a few pixels, that might move an important element of the window to a new spot. Then, your recorded cursor might miss a button and cause the whole macro to fail. There’s also normally a better way to accomplish your goal than playing back interaction. Some applications have Automator scripts, and AppleScript can be useful for even non-system application. Some professional apps even have their own automation tools, like Photoshop’s Actions. Try to explore those options before falling back on input recording.
Mouse recording is most useful in niche circumstances, like clicking the same button 500 times with a 1 second gap between clicks. If you want to do it, here’s how.
Using Automator to Record and Play Back Mouse Actions
Every Mac contains a built-in software called Automator. This application allows you to automate a set of basic actions on your Mac using a rudimentary, block-based programming language. But Automator doesn’t have blocks for everything since the minority of apps make their internal functions available to Automator. To get around this, Automator includes a featured called “Watch Me Do” that allows users to record and play back their actions, connecting any application to Automator via mouse automation. You can use this as part of a larger Automator workflow, or, as we’ll do, use it as a standalone action.
1. Open Automator from the Spotlight menu or Applications folder.
2. Click on the Workflow icon in the upper left and click “Choose” to create a new Workflow. Workflows are triggered from within the Automator application and run while the application is open.
3. Click the “Record” button in the menu bar. If you haven’t added Automator to your Accessibility menu yet, you’ll be prompted to do that before you can proceed.
4. Execute the actions you want to save as a macro. Any kind of input you provide will be recorded. This includes mouse clicks and movements, keyboard presses and touch pad gestures. It will also record any pauses or gaps between these actions.
5. When you’ve finished recording your repeatable actions, click the “Stop” button in the Automator HUD to stop the recording.
6. When you’re ready to play back your recorded actions, click the “Run” button in the upper right of the Automator window.
Using MurGaa Recorder to Record and Play Back Mouse Actions
Automator can be a little limiting, and it doesn’t always work properly. It gets confused and clicks on the wrong items, or crashes if a window has moved by a couple pixels. If you’d prefer not to use Automator, you can use the free MurGaa Recorder to record and play back mouse actions in macOS.
1. Download MurGaa Recorder from the developer’s website.
2. Unzip the download file and open the application.
3. Before you start recording mouse activity, you should set a keyboard shortcut for beginning and ending recording. This will make your recordings cleaner and more repeatable since they won’t include you clicking the start and stop recording buttons.
4. Use the start and stop keyboard shortcut to begin and end your mouse recording. A digital voice effect will confirm that recording has started and stopped when you successfully press your hotkeys.
5. Click the “Play Recording” button to play back your recording.
If you want to repeat the action more than once, change the number next to the “Play Recording” button. You can also set a delay before beginning playback or adjust the playback speed with the options at the bottom of the window.
If you only need to playback and record mouse activity in macOS rarely, Automator is a serviceable option. Users that need to playback and record mouse activity in macOS more frequently might consider a dedicated application like MurGaa Recorder.
I Hai, I Fixed Your Magic Mouse
Getting Started with Automator on Your Mac
3 Hazel Rules to Make macOS File Management Easier
Featured image by Christopher W. (originally posted to Flickr as The Apple Mouse) [CC BY-SA 2.0], via Wikimedia Commons