Accessing the 'Inspector' side panel in Mac PAGES

I tried to create a Keyboard Maestro macro relating to Mac Pages.

I needed to select an item in the Inspector panel on the right [in the illustration].

The purpose was to change the appearance of a word ['Purula']:

I needed to hit the 'Character Styles' button or menu, and then select the entry 'Casual'

This would have made it look like the word 'Pananka' 3 words to the left.

If I could find out how to do this, then I could make macros for other parts of the Inspector.

If you have a recent version of KM, you can use the recently enhanced "Press Button" action. You should read up on how that action works. I tried it, and found I could click the same button that you want to press using thie action:


The reason for the word "None" is that that is the text that shows up in that box by default.

Then most likely if you send a key to Pages, probably the letter C, it will select the font "Casual".

This is an idea for you to look into. I may not be able to provide a lot more information since I'm winding down before I go on a vacation.

Generally speaking, @Airy has it right: The Buttons action is going to be your best bet to work with the sidebar in Pages. However, even then its abilities are limited due to Pages' design. You can, in fact, pop up the character formatting menu by choosing Pages' first "None" button in the Button actions list:

However, that menu has zero keyboard interactivity: You can't type letters or arrows or even use the Tab key. So you're stuck at that point. The good news is that there's a specific solution available for the Character Palette, in terms of what Apple calls shortcuts. (Keep reading—and while this solution also applies to paragraph and list formatting menus, it has a severe limitation.)

Some general ideas on working with the sidebar

Beyond that, you'd have to use mouse click actions to really interact with the sidebar. The good news is that the sidebar's width and location is fixed, so you wouldn't have to use Found Images to click at the right spots. Instead, you could click at a defined offset from the window's top right corner, because the sidebar is always at the far right of the page.

There are two areas that make this more complicated - Spacing and Bullets and Lists can both be expanded. If you want to work with those detail areas, you might need a Found Image action to determine if they're expanded or not (if Found Image can't find an image of what shows in the expanded ranges, then that area is closed, etc.).

But ignoring that issue, this macro (which might need adjusting on your Mac) clicks on the Text Color pop-up menu, then selects and activates Advanced Color Fill. (Go figure, Apple made this menu keyboard navigable, unlike the Character Styles palette.)

Basically, you'll have to experiment and use a number of methods to get to various areas of the sidebar. There is no universal solution, unfortunately.

The Character Styles Solution

However, specific to the Character Styles palette (as well as the Bullets & Lists pop-up), Apple included the ability to assign each character style a function key shortcut:

The limitation is that you can only use F1 through F8, and they must be shared between those two menus. Ugh.

On my keyboard, I have to use Command + fn + function key to press a function key, so I'd use a set of simple actions in KM (in a group only active when Pages was frontmost) to send the right fn key:

In this example, Shift-Control-R would apply Red Bold if I had assigned F2 within Pages. (Ignore the Command key symbol in the screenshot—as explained, that's what I have to use to press F2. Normal keyboards would just say F2.)

But even better, you can extend this concept using KM's Conflict Palette. Create one macro for each of up to eight character styles, and give them all the same shortcut:

Each one has F1 through F8 assigned. In pages, select a word and press (in my example) Shift-Control-R, and you get a pop-up palette with all eight of the options:


Press 7 for red bold, 4 for strikethrough, etc. This method would let you use up to eight separate character styles with a couple key presses. (You could even set the palette to appear using a USB Device Key trigger of a double-tap on the Control key, instead of using a hot key -- even less finger work!)

If I used Pages a lot, I think that's how I'd set it up, as I'm most likely to want to use character styles, so I'd use all eight of my shortcuts there.

Hope this helps get you started…


1 Like


Thank you for your reply.

Guess what? I DID actually get it to work! Eventually.

The above is what did it. and your remarks set me on the track.

I could not see how the ‘Button’ solution would work, especially when you said "However, that menu has zero keyboard interactivity:”

So I tried the mouse location method.
I looked at your coordinates, and they seemed to be relative to the entire screen, not the open Pages document.
I found out that the Mac macro I use for screenshots (Cmnd-shift-4) actually provided coordinates—but for the entire screen, not in relation to a specific document.

I then put the Pages document in the top right-hand corner (i have a big curved screen a metre or more in width), and did some crude measurements with a ruler, and found out that the PAGES ‘Character styles’ button/menu was about 9 cm down from the top of the doc (9.75 cm from the top of the screen)
… and that my ‘Casual’ entry within it was about 10.75 cm from the top of the screen.

I did a rough ruler measurement for how far from the right I needed to think of (about 2 cm).
And with some primary school maths worked out the X and Y pixel measurements using the Cmnd-shift-4 numbers as a guide.

I also then discovered about the Go and Get (especially the latter) buttons, and used the 5-ping timer of the ‘Get’ button to put the cursor where I wanted, noting the coordinates.

So in the illustration above, the first of the two steps took me to the ‘Character Styles’ button, and the second to the ‘Casual’ entry within it.

It did not work at first, but then I noted that Step 2 was operating from the top LEFT hand corner instead of top RIGHT.

Once that was changed, I could not believe it when it worked!

In this second illustration there are several of the words I got to change font using my Cntrl-Shift-M macro.

This message is to thank you and @Airy for responding to my plea—so fully and so promptly.


Sunday, 17 December 2023 at 16:02:23

Glad you got it working!