Change Pages font size & other text attributes

Hello, how would I create a macro to set the following in the entire text (Cmd-A) of a Pages document:
Set color
Set font
Set font text size

thank you

Basically it goes like this:


[Test] Set Font Attributes in Pages.kmmacros (2.3 KB)


More info

2 Likes

Since @Tom provided an excellent macro to answer your question, I have moved it to the “macro” category where other users might look for Pages macros.

Thanks Tom!

Enjoy!

1 Like

thanks !

thanks very much for your most interesting reply, and taking the time to address my problem.

thanks again.

How would I modify the macro in such a way that it would apply to selected text only?

Is there any way to make the macro usable in multiple apps, like Pages and also Notes

where would I find the names of the colours. I usually chose my colours from a nameless palette.

thanks again very much

I’m not an expert when it comes to color names used by AppleScript but maybe this may be a hint. I’m sure the AppleScript experts on this forum can tell you the exact reference for these color names.

In theory, yes. But every app has its own terminology. So you’ll have to make sure that it fits.

I’m not sure (I’m not scripting Pages, usually) but I think this can only be accomplished via UI scripting. If you are really interested in this I will write a macro for you. But, as always, UI scripting is the last recurse, and most of the time (or: many times) it will produce more problems than it solves.

1 Like

Hello Tom,
Thanks again very much for your answers. I read your answers and did more research:

  • names of colours: I found the answer. If you press Shift-Cmd-C for colors, the names of the colours appears when the cursor passes over the colour (in the crayon display)
  • usable in multiple apps: I make a version for each of the few apps I need it for. No need to complicate things (I am speaking to myself!)
  • applying to selected text. Please do not waste any time writing a macro. I thought that it would simply be a question of replacing ‘body text’ with something like selected text. I found, bought and tested an excellent little app in the app store called Print Selection, which … prints the selection wherever you are. I thought that your excellent macro would be simple to modify.
    thanks again very very much !

Hey Ronald,

You can’t – at least in Pages 5.x – which has decimated the app’s AppleScript dictionary. It no longer has a selection property.

Maybe in a future update.

-Chris

1 Like

thank you Chris