Custom Background Color Shortcut
Custom Background Color Shortcut
I'd like to create some custom background colors, and then have keyboard shortcuts for them. Is this possible?
MacBook Pro (mid-2015)
macOS X Big Sur 11.2.2
Nisus Writer Pro 3.2.1
macOS X Big Sur 11.2.2
Nisus Writer Pro 3.2.1
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Custom Background Color Shortcut
What you want is possible, but you'll have to set the colors indirectly. There's no built-in feature for adding custom colors to the menu directly. Here are a few options:
1. Apple's standard color panel (as used in Nisus Writer) lets you add custom colors. Once you've summoned the color panel in background color mode, you can click your favorite to apply it. That won't allow you to use a keyboard shortcut, but I thought I'd mention it.
2. Instead of applying a custom color to your text, why not apply a character style to your text? Your style can enforce the desired custom color. Styles can be assigned custom keyboard shortcuts, and have so many other benefits, eg: easily updatable, import between documents, etc.
3. If you don't want to work through styles, then a custom macro might be a good solution. You can create a macro for each particular color, and then assign the macro a custom keyboard shortcut. Such macros are simple to write. Here's an example:
I hope that helps. Please let us know if you have any questions.
1. Apple's standard color panel (as used in Nisus Writer) lets you add custom colors. Once you've summoned the color panel in background color mode, you can click your favorite to apply it. That won't allow you to use a keyboard shortcut, but I thought I'd mention it.
2. Instead of applying a custom color to your text, why not apply a character style to your text? Your style can enforce the desired custom color. Styles can be assigned custom keyboard shortcuts, and have so many other benefits, eg: easily updatable, import between documents, etc.
3. If you don't want to work through styles, then a custom macro might be a good solution. You can create a macro for each particular color, and then assign the macro a custom keyboard shortcut. Such macros are simple to write. Here's an example:
Code: Select all
$color = Color.newWithHexTriplet("00CCFF")
Set Background Color $color
Re: Custom Background Color Shortcut
It's good to know I can create a Character Style that way, but in this instance it will create a problem since I'm trying to add background color to text that is already in several different Character Styles (and needs to stay that way).
I've read through the introduction to macros in PDF manual, but unsure how complicated it would be to learn the "language"
I created a macro with your code (blue color) successfully. But don't know how to customize that in creating a new macro. And would the keyboard shortcut for macro be written into the macro code itself, or that's in keyboard preferences, like other formatting options?
Thanks, Matt
PS: should I move over to Macros forum?
I've read through the introduction to macros in PDF manual, but unsure how complicated it would be to learn the "language"
I created a macro with your code (blue color) successfully. But don't know how to customize that in creating a new macro. And would the keyboard shortcut for macro be written into the macro code itself, or that's in keyboard preferences, like other formatting options?
Thanks, Matt
PS: should I move over to Macros forum?
MacBook Pro (mid-2015)
macOS X Big Sur 11.2.2
Nisus Writer Pro 3.2.1
macOS X Big Sur 11.2.2
Nisus Writer Pro 3.2.1
Re: Custom Background Color Shortcut
Hello Matt,
You would need to copy the above two line macro for each background color you wanted. You can customize it by changing the hextriplet. You can find the hextriplet for any color you want using the color panel. Just switch to the RGB sliders. Below the sliders you can see the Hex Color # for the selected color.
The Nisus macro language allows you to specify the color using the RGB system as well, either as fractions (0.0 – 1.0) or as 0-255 values, but the hextriplet method is the shortest.
To set a shortcut for your color, you will first need to save the macro giving it a name, and then set the shortcut using "Menu Keys" preferences.
You would need to copy the above two line macro for each background color you wanted. You can customize it by changing the hextriplet. You can find the hextriplet for any color you want using the color panel. Just switch to the RGB sliders. Below the sliders you can see the Hex Color # for the selected color.
The Nisus macro language allows you to specify the color using the RGB system as well, either as fractions (0.0 – 1.0) or as 0-255 values, but the hextriplet method is the shortest.
To set a shortcut for your color, you will first need to save the macro giving it a name, and then set the shortcut using "Menu Keys" preferences.
philip
Re: Custom Background Color Shortcut
Got it! Thank you.
MacBook Pro (mid-2015)
macOS X Big Sur 11.2.2
Nisus Writer Pro 3.2.1
macOS X Big Sur 11.2.2
Nisus Writer Pro 3.2.1