I'm writing documents relating to the game of contract bridge and need the ability to easily insert suit symbols. I've just discovered AutoHotKey and am very happy with the results.
I have created a script file with 4 scripts like :?*:! C::♣. (without the space between ! & C) This works well, but the icing on the cake would be to have the heart and diamond symbols appear red.
Is there any way to save the current text colour, change it to red before inserting the symbol and then restore the original colour?
Thanks
Tony
Change text colour in a hotkey
Change text colour in a hotkey
Last edited by BoBo on 15 Apr 2021, 05:07, edited 1 time in total.
Re: Change text colour in a hotkey
The easiest way to do it is to have to separate Text controls, one for the rank and another for the suit. Then you can make the color for the suit Text control red. You can do that and position them right next to each other so they'll look like they do now, except if the rank character(s) gets wider, like Q or especially 10, it will change the natural position for suit that would be next to it as a separate control. One way around that is to use a monospace font like Courier New for the rank and use T instead of 10. Another way is to have the rank Text control be right-justified so it's allowed to grow and shrink on its left side so the right will stay butted up to the suit.
Having just said all that, I realized that you're talking about hotstrings and not GUI controls, so all that is out the window.
There are different ways to handle changing colors depending on what app you're using to type into with your hotstrings.
Having just said all that, I realized that you're talking about hotstrings and not GUI controls, so all that is out the window.
There are different ways to handle changing colors depending on what app you're using to type into with your hotstrings.
Re: Change text colour in a hotkey
Thanks for the reply, boiler.
I am typing my documents in open office. The manual way to change colour is to highlight the text and then use a colour-picker from the menu. An alternative would probably to do a global replace at the end of the text and change all diamond and heart symbols to red. I've never tried that in OO, it did work in MSWord.
Ideally, I would like to do it on the fly using a hotkey.
I am typing my documents in open office. The manual way to change colour is to highlight the text and then use a colour-picker from the menu. An alternative would probably to do a global replace at the end of the text and change all diamond and heart symbols to red. I've never tried that in OO, it did work in MSWord.
Ideally, I would like to do it on the fly using a hotkey.
Re: Change text colour in a hotkey
The best way is probably to interface with OO via the Open Office API.
Who is online
Users browsing this forum: todd and 52 guests