Activating buttons and lists

This is my first macro, that might work.

I am trying to activate the sound panel in Mac Preferences for Mavrick. I have no ability to write script.

So I am using the button macro. I want to activate the output button in the sound panel.

This is too ambitious I suppose, but I want to scroll down to the last item in the list. I think I have to get the mouse to that list output devices. Then I tried a list of down arrows with an x set variable in between each one. I want to activate the last option in the list.

Hey Ellenm,

All you have to do is:

  1. Open /System/Library/PreferencePanes/Sound.prefPane
  2. Pause Until front window of front app is entitled ‘Sound’
  3. Select Button ‘Output’
  4. Type keystroke ‘tab’
  5. Type keystroke Option-Down-Arrow

Best Regards,

Thank-you Chris,

If this works, it will be my first macro in my life.

I think I set it up as you said, but something is wrong. I think it has to do with the pause. Maybe they are not long enough.
There are two major steps. 1.) I have to open a program that takes a little time to get started.

It has a button (Continue) that has to be clicked on to do the next step.

2.) The sound panel needs to select the mic.

The steps for the sound panel of preferences that you suggested worked when I did it manually, but they are not working in the macro.


I do get the two windows, but none of the button clicking etc.

Set Variable "pause until" wont do anything.

Use the Pause Until action.

Ideally, Pause Until the button with title is enabled.

Hey Ellenm,

That's because you misunderstood a step.

As Peter mentions 'Pause Until' is a KM action.

Open Sound Preferences.kmmacros (3.0 KB)


If you see a step on the KM board like 'Pause Until' or "Pause Until" or {Pause Until} always try to find those words in the KM Actions Inspector, and pay close attention to the context — as it usually provides some clues.

Don't worry. I myself was very confused by the way KM did quite a few things when I first started using it, and I've been using automation utilities since 1985.

Generally it's a better practice to use the 'Activate a Specific Application' Action to open applications, rather than opening them as files with the Finder (not that the latter is wrong).

Best Regards,

Yeah, I'm getting there.
The sound panel from the system preferences worked.
I am still stuck with the mic selection in Dictate. I tried treating selection as a button, but that does not work. I think it is some kind of list. It seems I need to click on the specific mic. I have only one mic loaded now, but I actually have two mics. So, being able to select one would be good.

(I put in a timed pause after the keystroke because the sound panel was not working either and that seemed to fix it, Maybe, when I get done, I can show you a picture of the whole thing and you can see what is unnecessary.)

Here is the Dragon Dictate window.

The button for continue did not work. But I found that a return keystroke did work. I guess this is a trial and error process with many options.


Those do not look like real buttons. In fact, I’m not sure what they are, it looks like some sort of custom UI widget.

I think you’re stuck with clicking at the appropriate location. If it is in a fixed location relative to a corner of the focussed window, then you can use a simple click action. Otherwise you might have to use a click relative to a found image.

To click relative to an image, you use the Mouse Click action, configure it to be relative to a found image, and take a screenshot of the desired area of the screen using Command-Control-Shift-4, and paste it into the image well on the action. The image has to be unique (which includes not being visible in the action if the image is small enough not to be shrunk in the image well) otherwise Keyboard Maestro will not know where to click. The Display option in the action will allow you to see where Keyboard Maestro is matching.

Dear Peter,
Thank-you for your instructions. Your instructions seem pretty clear, but I am missing something in my understanding.

I don't quite konw how to interpret how I locate the cursor on the window where the "UI widget" is. I ran the recorder and used the numbers that resulted from clicking on the upper left hand corner and the target place. But, nothing happens. I am probably misunderstanding.
Here is what did not work:

You almost always need a pause before a click action to ensure the screen is up to date. So two clicks in a row is a warning sign. If the first click changed the screen at all, it is likely that a pause is needed between them.

Also, when debugging this sort of thing, turn off “Restore Mouse Location” so you can see where Keyboard Maestro moved the mouse (and adding a large pause after the first click and show you where the first click was as well).

“VXi X200 v1.0” is probably not a real button, so the Pause Until next the end of the macro will likely never succeed.

I could follow most of what you said. I turned off the "restore Mouse Location" box and changed the pauses to 5 seconds.

Sorry to be so dense, but I don't see the cursor moving. Where do I look to see that. There is no cursor on the window where I moved the cursor using KBM.

This is the window where I am imagining that I should see the cursor but see none. You see what I see.

You should be able to see the mouse pointer after the move, although the application may hide the cursor.

You can use the Highlight Location action to show you where the mouse location is.