New String and Array Functions for Macros

May 28, 2017

Today Onetastic update 3.5.0 is available, greatly expanding the built-in functions that manipulate arrays and strings. Following are the newly added functions:

New String Functions:

New Array Functions:

The documentation for all the new and old string and array functions are updated with descriptions and many examples of how to use them. These new functions will greatly simplify writing macros.

Macro Updates

Following macros in Macroland are updated:

Tag Summary for Specific Tag

Added an option to find paragraphs that have at least one of the specified tags (as opposed to having all of the specified tags at the same time)

Number First Cells

Added an option to skip the first row which may be a header row. Also it will now only run on the selected table

Tag Summary with Page Names

Added option to include section names with the page names in the output

Sort Sections

Added ascending/descending options and updated to sort numerically if section names start with numbers like 1, 2 etc. This correctly puts a section named 10... after sections named 1... through 9...

Text to Table

Fixed certain cases where the table would not appear at the location of the selected paragraphs.

Content Map in Current Section

Better monospace font used.

Content Map in Current Page

Better monospace font used.

To-Do List with Page Names

Fixed a bug where it wouldn't display any results on the result page

Column Widths+

Bug fix: Infinite loop, Simplified code

Task Count + Tags

Modified the way tags are counted so that all tags on a single paragraph are counted (e.g. if there is two different checkbox tags, both will be counted). Added counting of question mark, exclamation, star, and pin tags to the title.

Light Ruled Lines for White Page

slightly darkened lines

New Macros

Several new macros have been added to Macroland since the last update. Check them out:

Proofing Language -> Danish

Sets the proofing language on selected text to Danish

Add Footer to All Pages

Adds the given text to the end of all pages in the current section

Insert New Page At Top With YYYY-MM-DD + Title

The title is in form of yyyy-mm-dd plus text as entered in a dialogue-box. Result will be e.g. "2016-10-16 Meeting with XYZ". This helps to always keep the newest pages on top and also allows sorting pages 'alphabetically' by date. Helpful if many pages (e.g. meeting minutes of a project or customer are collected in one section).

Recent Edits with Author Info

Displays a summary page of recent edits in current section/section group/notebook or all notebooks with author info that made the edits and date

To-Do List with Page Names

Creates a page at the top of the section that lists all un-checked To-do tags. It is titled "TO-DO List (yyyy-mm-dd h:mm)".

Normal Text

Changes the text style back to normal after code mode (Calibri 11 pt with no background). Works even when no text is selected.

Code mode

Changes the text style to code (Consolas 10 pt, with a very light background, reminiscent of Evernote Code Blocks). Works even when no text is selected.

Add icon to all emails

This macro will change the title of each page in the current section to add an email emoji to the beginning (unless it already has one). This has been made specifically for emails sent to OneNote from Outlook. Great from seeing all emails in a section at a glance.

GrayBlack Theme

Changes the background color of all the pages in a section to GRAY and converts existing text to BLACK.

Sort by Tag

Sort selected paragraphs by their tag name. Has the option to run on selection only. Takes all tags for each paragraph into account in case they have multiple tags applied

Task Count++

Modified version of Task Count by Dawid. This macro counts all checkboxes and adds how many are completed to the title of the page. This version counts all checkbox style tags (including CheckBox priority 1 - n). Furthermore, it counts all tags applied to the same paragraph rather than just 1, so if two checkbox tags are applied to the same paragraph, it will count both of them.

Add icon to page title

Adds an icon (emoji) to the front of the title, for easy reference of page type. For example, use "✉" as the first character to easily identify pages created from emails.

Select Highlighted

Selects all highlighted text on the page

Comments

Name
Comment
Alex_ - 2019-04-13
I also do wonder if/how Onetastic supports working with the text from the clipboard.
For example, is is possible to apply an extra transformation to say "Paste and Merge Formatting" action?
E.g. modifying a certain property of the paragraphs to be pasted?
joShu - 2018-04-14
Clipboard to String

Can the contents (text) of the clipboard be assigned to a string?
e.g.: something like:
$string = %clipboard%


SysAdmin - 2017-07-09
Can you add a function that will call an external function passing some parameters and getting some return values?

For example, the function can call an external Dotnet dll/exe file, a Powershell script, or even a DOS batch file with a string argument and get back a string in return.

Other Posts

Show all posts