Jump to content
Sign in to follow this  
tedg

Keyboard Shortcut for Text Color

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?

Share this post


Link to post
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 ) ) ]

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Duh. I had the select all checkbox checked. Many, many thanks.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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