Underlying Style Support for Custom Styles and Macros

July 11, 2020

Onetastic Custom Styles provides an easy way to quickly format your text with your choice of font, color, size and other formatting. However until now it didn't set the underlying style for the paragraph to one of the built-in styles supported by OneNote. For instance you can use Onetastic's custom Heading 1 style to format a paragraph but it would still use OneNote's built-in Normal style. With the latest update, Custom Styles can now also set the underlying style of the paragraph to one of the built-in styles. If you use Heading 1 custom style, it will use its unique formatting but will also mark the paragraph with the built-in Heading 1 style from OneNote.

This has the benefit of using macros like TOC in Current Page on pages where you used custom styles. Such macros check underlying style of paragraphs to find headings and wouldn't previously work with headings formatted using Custom Styles. You can see how this now works in the below video.


Macros can now change paragraph style

Paragraph objects in macros had a read-only style property. With this update this property is now read/write so you can change the style of a paragraph to one of the built-in styles. Following is a list of accepted values: p, h1, h2, h3, h4, h5, h6, PageTitle, cite, blockquote, code. A sample macro demonstrating this is available here: Sample - Insert Styled Paragraph.


hb - 2020-10-26
when I crop an image, I can move or resize it freely.
Anonymous - 2020-10-20
Please make onetastic available to Macs.
Help please - 2020-09-30
I'm trying to create a simple macro where after I have selected a text, I click the macro and it comes up as a colour picker, and I choose a colour, and that colour becomes the highlight/marker on the text. I've searched all the macros and haven't found any exactly like it. But I can't figure out how to do it. This is what I've gotten so far:
LocalStore_Read("color", $highlightcolor)
$dialog_box = DialogBox_Create("")
DialogBox_AddColorPicker($dialog_box, "&Color", "color", $highlightcolor)
$highlightcolor = $dialog_box.controls["color"]
LocalStore_Write("color", $highlightcolor)
$Text.selected = true
GetCurrentText().highlightcolor = $highlightcolor

It's important that:
1. Only the SELECTED text is HIGHLIGHTED
2. I CHOOSE the highlight colour from COLOUR PICKER

That's all! Please help!

Other Posts

Show all posts