Jump to content

Keyboard Shortcut for Text Color


This topic is 4271 days old. Please don't post here. Open a new topic instead.

Recommended Posts

What I want to do is manually select a word or two and hit a keyboard shortcut that turns the text color to red.

I have (on my Mac) Keyboard Maestro, which can select a menu and/or do all sorts of UI tasks. But to change to red you have to select a swatch from a palette.

I think the solution will be to make a script that does something similar to TextStyleAdd (red). Then I can just select that script from the script menu.

But the script creation window seems to allow only a few commands, none of them related to text.

Can I do this?

Link to comment
Share on other sites

the script creation window seems to allow only a few commands, none of them related to text.

That is correct; you need to use a calculation in your script, for example:

Insert Calculated Result [ TextColor ( Middle ( Get ( ActiveFieldContents ) ; Get ( ActiveSelectionstart ) ; Get ( ActiveSelectionSize ) ) ; RGB ( 200 ; 0 ; 0 ) ) ]

Link to comment
Share on other sites

Yes, the Insert Calculated Results command is what I was missing.

Trying your example, it turns the entire field red! All I want to do is select a couple words and have the script turn those words red.

Thanks.

Link to comment
Share on other sites

This topic is 4271 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.