Google document xpath clicking issue

What I’d like to do is clicking a specific color to style the selected text in Google document, such as the ‘cornflower blue’ ▼


Does anyone can solve this problem?

I've tried following three XPath but failed:

//div[@title="cornflower blue"]

//div[@data-tooltip="Text color"]


Just in case you don't use Google document, Here is a draft for you to test it out.

Hi Alice

There are so many issues with this macro I'm uploading, but perfect is the enemy of good and this might do what you need, so here you go. It's possibly going to give you ideas at least. I tried to use javascript for a bit and then decided that Google Docs has such a complicated interface that javascript would take more than my skill to get working. This uses the "found image" functionality in keyboard maestro. If you're not familiar with it take a look at this wiki page:

The first image I used was this one for reference. 37

change google docs text colour Macro (v9.0.2)

change google docs text colour.kmmacros (21 KB)

@vincent_ardern Thanks, Vincent! But since founding-image is a very battery consuming method, I'd really hope if there is a better way to do this.