New Properties, Bug Fixes and Syntax Highlighting for Macros
July 30, 2016An update is available for Onetastic that adds new properties to objects in Macros, fixes some frequently reported crashes and adds syntax highlighting in Macro Editor.
New PropertiesFollowing properties are added to Macros:
- "indent" property is added to Paragraph objects to allow creating indented paragraphs. TOC macros are updated to take advantage of this. If you download latest versions of TOC in Current Notebook, TOC in Current Section and TOC in Current Page macros, you will see that they now generate indented paragraphs within the table of contents. This allows collapsing expanding parts of the TOC.
- "index" property is added to Paragraph objects to determine where a Paragraph is in an Outline. This can be useful when inserting new paragraphs right before or after a certain paragraph by using its index.
- "paragraphs" property is added to Outline and Cell objects to easily get the list of paragraphs from them. This was possible using QueryObjects function, however that function returns them in depth-first-search order which isn't the natural order of paragraphs you would expect from an Outline. The new "paragraphs" property will return a flat list of paragraphs.
Syntax HighlightingMacro Editor will now highlight the syntax of your expressions making it easier to read the code. It was mostly black with only keywords in blue and comments in green before, and now variables, properties, string and boolean expressions will use different colors. Also expressions will be highlighted with a background when you hover over them making it easy to see which expression will be edited when you click on them. See below for a visual comparison:
Old Macro Editor with limited syntax highlighting
New Macro Editor with improved syntax highlighting
Bug Fixes and ImprovementsFollowing bug fixes and improvements are also included in this update:
- Fixed an issue where pinned favorites would open in the wrong OneNote window
- Fixed an issue where comparing variables of different types would cause a macro error
- Fixed a crash that occurs while displaying message boxes in macros
- Fixed a crash that occurs while sorting objects in macros
- Updated macro logging to provide better representation of multi-dimensional arrays
Head over to the downloads page to download this update.