Add Color Picker to Your Macros

April 19, 2019

With a new update, you can now use Color Picker in your Macro dialogs using DialogBox_AddColorPicker function. In the past when a macro needed user input for a color, the only option was to use a text box and ask for a hex color code which is much harder for users who just want to pick a color from a set of common colors.

Color Picker control looks like this in a dialog box:

Color Picker control

When user clicks on the dropdown, the standard Windows Color Picker is displayed to allow user to pick a color:

Color Picker window

Along with the color picker, a new base type Color is added. Certain properties of objects, like fontColor or highlightColor used to be String types. They are now using the new Color type. Color type has a few advantages over the String type. If a font color of a text is red, previously doing $text.fontColor == "red" wouldn't work, you would have to use the hex format (#ff0000). Color type is smart enough to compare color names and values, therefore such comparison or assignment will now work. There is also a new Color function to create variables of type color.

Macros that used to offer a dropdown with a set of predefined colors will be updated in the coming days to use the color picker.

Update information for Macros

Another feature added in the new update is the ability to see what updates are available for an installed macro. If you are looking at the details of an installed macro in Download Macros window, you will now see which updates are available and which version you currently have installed:

Available updates

This way you can see what the new update offers and decide whether you want to update to the new version of a macro or not.

Comments

Name
Comment
David Ellinger - 2021-06-02
Anyone know about recording macros for Onenote? I want to make a macro that will switch pen colors. So when I'm working I don't have to click on the top...I can just type CTRL-B for Blue, CTRL-K for Black, CTRL-G for green, etc. Thanks.
Bernd Walther - 2020-03-08
awesome
will it run with OneNote for Windows 10 (uwp) as well?
greetings from Bernd Walther, Hamburg, Germany
胖胖 - 2020-02-28
I'm can't use the macros,Is the need to pay cost to solve it?

Other Posts

Show all posts