I tried using the macro record feature, and did a number of mouse clicks. It seemed to work. However, when triggering the macro, it appeared that KM did all the clicks instantaneously, and my software didn’t have time to respond. (It’s a slow and largely non-standard, non-conventional OS X app.)
In the macro editor, I dragged “Pause” actions in between the clicks, and then it worked. However, this was a lot of work and it’s a lot of work to tweak the pause length for every single click, so I was wondering if there’s a way to insert pauses automatically.
Mike
Mike,
While recording/using mouse clicks seems like a great way to build a macro, turns out it is not the most reliable method.
But to directly answer your question, yes, you can change the delay (pause) time between all Actions in a macro. Put this Action at the top:
For more info, see action:Set Action Delay [Keyboard Maestro Wiki].
If you'd like to provide us with more info about your workflow, perhaps we could offer some suggestions:
- Apps used
- Source data (if any)
- Desired outcome/result
- Screenshots of app you're trying to automate (cut/blur any sensitive data)
- Detailed steps of your manual workflow.
1 Like
Okay I'll mention a few aspects of my workflow.
I'll start with Sibelius.
I'm using a couple programs that started as Windows programs and the designers didn't make a very natural transition to OS X. One of them is the music typesetter Sibelius. Typically I would have a few files open, and each file gets its own window. Here there is a larger window, more near the top, titled "simple-08", and a smaller one below it "simple-07"
As you can see, the useful Sibelius menus are actually on the window, not on the OS X menu bar.
So I want to access a menu option on the "View" menu on the top sub-window ("simple-08"). First I would zoom "simple-08" so the top of the window is in a consistent location.
Then I would click on "View".
Here you can see that these are not actually menus, but "ribbons" as introduced in Windows back in the late aughts and maintained in Sibelius despite being a pretty stupid idea (in my opinion).
Then I would click on the word "Zoom" below the mag. glass and click on the option I want:
An alternative method to using Keyboard Maestro is simply to look up the keyboard shortcut that Sibelius uses. However, this is a pain because (1) the documentation is hard to read and hard to locate and (2) as you can see there are many more functions than available keyboard shortcuts.
I thought it would be great to record mouse clicks because I can see what I'm doing while I make the recording. Now, I realize that mouse click locations can be a problem, because apps do rearrange and resize their windows, and the actual option you want may be somewhere other than the location you recorded. But it most cases I am aware of how and why Sibelius arranges its windows, ribbons, and menus, so I won't get tripped up.
Here is another job I need to do:
I am using a media player program Jriver Media Center. It is also extremely non-idiomatic for OS X.
When I launch it, the window is small, like this:
It's not really useful until I zoom it.
Then I would select "Tools" and then "Options."
This brings up a dialog box in which the item I want is a drop-down menu located under "Audio Device". Here's what it looks like when it is dropped down.
The actual item I want is different depending on what hardware is attached to my MacBook, but I've noticed that JRiver always places the one I want in the 3rd position. So I can record myself clicking on that location.
This is the macro that needs pauses between clicks, as JRiver responds slowly to mouse clicks.
Thanks for sharing your workflow and screenshots. This really helps us help you.
From a very brief research of Sibelius, it would appear that it does NOT support scripting on the Mac. If it does, that would be the best approach to controlling it.
But it does appear that it offers numerous keyboard shortcuts, and even allows you to set your own:
See Add custom shortcuts for Keypad features in Sibelius
Making use of Sibelius shortcuts is probably the next best approach.
Using those shortcuts, you can create KM Macros to use them, combine them, or use other hot keys to trigger them. I'd suggest that you start there, to identify as many Sibelius shortcuts as you need.
If there are no shortcuts available, you could use AppleScript System Events to manipulate the UI.
Take a look at these options, and let us know if you need further help.
When recording, you can click the clock icon in the Recording window to add a quarter second pause to your recording.
I’m a bit confused, as it seems so easy to record clicks. I’m not sure what the problem with that is.
The keyboard shortcuts in Sibelius are not an option most of the time. First, using the dialog to assign shortcuts is a pain (the functions are listed with strange names so it’s hard to know what I’m actually telling the key to do), second only about 25% of operations I do in Sibelius are even available in the dialog where you assign shortcuts.
So, is AppleScript system events easier than recording clicks? Assuming that when using AppleScript I’m directing clicks to certain locations (maybe that’s not right?) I have to figure out where those locations are–the click recorder in KM seems like exactly the tool for that job.
Yes, I discovered that in the documentation a short time ago. It said a “1-second pause” in the docs – is that not right? It’s 0.25 seconds?
It was 1 second, it is now 0.25 seconds (press it multiple times to increase the pause).
I checked the Recording user manual section and it says 0.25 seconds, which documentation are you referring to?
The main issue is that the smallest change in the UI can cause a failure:
- Resizing a window could move the element you want to click on
- App update to move or remove the position of the element
- Even changing stuff like the font or font size used by the app could change the position
Even if it is difficult to find or create the needed keyboard shortcuts, it is a one-time activity.
After that, you will have a reliable, repeatable solution.
You might also play with the KM Action "Press Button":
You can use this with a IF test for the button, like this:
Notice the grey "(currently false)" text shown in the IF Action?
This is updated in real time.
Open your app, and show the menu/button of interest.
Type its name in the IF Action, and see if the status changes to "(currently true)".
I found it by a general Google search, and it may have taken me to an older version of the docs. I don’t remember now where it was.