Previous 1 2 Next 15 Replies Latest reply: Feb 11, 2015 9:17 AM by TomU
Chuck Risher Level 1 Level 1 (125 points)

I need to be able to make scripts/macros by recording keystrokes and mouse clicks with location.

Is this possible with Automator?

Does anyone know of a way program to do this?

It seems so simple.


MacBook, Mac OS X (10.5.4)
  • Kappy Level 10 Level 10 (262,895 points)
    Open Automator, select Automator Help from the Help menu, search for "record." The first article explains how to record actions.
  • Chuck Risher Level 1 Level 1 (125 points)

    I do not see anything about recording the location of mouse clicks or recording keystrokes.

    When I click record, they are not recorded.
  • Kappy Level 10 Level 10 (262,895 points)
    Copied from the help file - did you find it?

    Recording your actions

    You can create automations by having Automator record what you do. Automator can record your keyboard and mouse events and create a custom action. This new action, called a “Watch Me Do” action, contains the recorded series of events. When you run your workflow, the recorded events are executed.

    NOTE: For Automator to record your actions, “Enable access for assistive devices” must be selected in the Universal Access preferences.

    Open Universal Access preferences

    To have Automator record what you do:

    Before you begin recording you should consider where the recorded actions should begin. You may need to set up the environment before you start to record. For instance, if you expect that an application would be open when the workflow is used, then you should open the application before you begin recording.

    In an Automator workflow, click Record. The Automator:Recording message appears with the stop button.

    Perform the series of steps that you want recorded.

    When you have finished the steps you want recorded, click the Stop button.

    Click Run to test your recorded actions.

    You can adjust the settings of the action to change the way your recording performs:

    ■ If you want to remove an event from the list, select the event and type Delete.

    ■ If you want to set a timeout limit for user action, adjust the Timeout using the up and down arrows.

    ■ If you want to change the speed the recording plays back, adjust the playback speed using the slider.
  • Chuck Risher Level 1 Level 1 (125 points)
    Ohhh. Okay. I see. Thanks.

    I also need it to record when I click and drag, but it isn't recording that it seems. I click and drag, but when I play it back it only clicks.
  • Kappy Level 10 Level 10 (262,895 points)
    Can't help you with that, sorry.
  • Lexxiconn Level 1 Level 1 (0 points)

    Precisely the same problem. I drag the screen to top left but when I play back it clicks mouse then moves it - does not function correctly for drag recording.


    Is there a short cut key sequence like the home function most apps have to get to top left corner to over come this - you want all macros to start at a known point.


    Also the step button just runs the whole work flow not one step at a time and the shortcut CTL+. does not stop an out of control macro from excuting any further. These I would think would be basic functional requirements of a macro language (known start and stop and basic debugging). So far this tool is very disappointing. Only simplistic functions work reliably.

  • TomU Level 1 Level 1 (0 points)

    I tried to do an automator action that recorded cutting a line of text from one application and pasting it into another.  Many problems.  Automator could not even correctly replay selecting menu item "Edit -> Cut".  I'm surprised at how poorly this utility work.

  • mns579 Level 4 Level 4 (1,155 points)

    Although a given Record/Watch Me Do action in any workflow may work, it's also likely to fail.  It's important to understand that the Watch Me Do action records mouse and keyboard actions as they take place on screen.  If the (aptly abbreviated) WMD action doesn't find the expected screen elements--everything just where it first was when the recording was made--it will usually give unexpected results or just abort.  In other words, WMD doesn't, for instance, look for an open TextEdit document, identify a line of text, and then navigate the menu to Edit > Cut, etc. It simply navigates to a screen location and tries to type/click/drag/etc. as it has been instructed in that spot.  A few pixels off or if the menu bar has changed because TextEdit is no longer the foreground application, boom!

  • BDAqua Level 10 Level 10 (121,205 points)

    Great info, thanks!

  • TomU Level 1 Level 1 (0 points)

    I understand all that.  I'm not moving things around.  Automator can't even click the same menu.  The menu's don't move but it consistently selects an item from the menu one to the right of the "Edit" menu.  I really can't understand where it is going wrong.

  • BDAqua Level 10 Level 10 (121,205 points)

    What happens if you move the Window about one Menu item to the right?

  • mns579 Level 4 Level 4 (1,155 points)

    Be sure that you're precise as you select the menu bar (File/Edit/Format/etc.) item. If you "glide" over Format and momentarily activate the Format submenu before you come to Edit and its submenu, WMD may reference Format as a navigation anchor.


    Consider surer keyboard-shortcut approaches that would use, for example, Command-X for Edit > Cut.


    Or, if Automator is indeed performing one-menu-over "consistently," BDAqua's approach could work, too.

  • TomU Level 1 Level 1 (0 points)

    Keyboard shortcuts were often missed.  For example, I tried this sequence many times. 

    0: (setup:  text editor is scrolled to first line and cursor is at the beginning of the first line)

    1: Click on text editor window to focus it.

    2: press SHIFT-DownArrow to move cursor down one line and select the first line

    3: press CMD-X to cut the line.


    Automator never would capture those key strokes. 


    But today I has a break through.  This sequence does work:


    0: (setup:  text editor is scrolled to bottom of the file and the cursor is placed below the last line.)

    1: Click on text editor window to focus it.

    2: press SHIFT-UpArror to move cursor up one line and select the last line.

    3: press CMD-X to cut the line.


    about 70% of the time this did get recorded correctly (I did maybe 3 recordings and one failed to select).  Once it got recorded correctly it worked reliably. 


    So it seems to be able to capture some sequences but not others.  Both sequences work very reliably when I type them but automator can only capture the last sequence. 


    Thanks for the suggestions.  This tool is better than nothing but not anything I would recommend.

  • mns579 Level 4 Level 4 (1,155 points)

    Good to hear.


    Sometimes it helps to move slowly so that Automator captures everything. I do agree with you though: Automator is sometimes unpredictable yet better than nothing for the nonprogrammer. It's certainly easier than learning AppleScript, which is the path that a programmer would take to create a more reliable, robust procedure than Automator's WMD can produce.

Previous 1 2 Next