Local Storage for Macros

Macros can Now Remember Settings and Other Data

January 23, 2018
An update for Onetastic is available today with two new functions to read and write data on the local computer, similar to how Windows Registry works. This is called Local Storage. Data stored in Local Storage is available across multiple executions of the same macro. These new functions are:

These can be used to save any data type other than an Object. If it is an Array, it cannot contain Objects.. The data is stored in a key-value pair store on the computer and is available from the same macro in the current or subsequent executions. See more info on how to use these functions in the documentation.

Saving Macro Settings

One very useful way to use this persistent data is to store and remember user input for subsequent executions of a macro. For instance Search & Replace macro remembers the values user entered in the dialog box so that it can present those same values when the user runs the macro again. Similarly settings in a macro, like which day of the week the calendar should start for Insert Monthly Calendar macro, can be stored and retrieved.

These and a few more macros are already updated to take advantage of this. This will greatly improve usability of these macros, so that if you are using them with non-default settings, you won't have to keep changing the settings, or if you use Search & Replace multiple times with same values, you won't have to re-type them.

Debugging Local Storage

Object Browser in Macro Debugger will display the values stored under the Local Storage section at the bottom:

Object Browser Local Storage

Comments

Name
Comment
hguilfoy - 2018-02-19
This is PERFECT! Just need to clarify....
1. Go to page to select
2 Pin to Favorites
3.Select Manage Favorites
4. When File Explorer opens drag the desired page to the OneNote icon on the task bar.
Nate L - 2018-02-19
I have installed Onetastic and loaded a couple of macros... all good. However whin I click "Launch OneCalendar" nothing happens. No calendar, no error, nothing. The version I downloaded (32 bit) matches the OneNote version I am running. Any suggestions?
Hguilfoy Reply - 2018-02-18
@hguilfoy
I do not think there is any way to pin your page to the taskbar by itself, but you can pin it into the OneNote - When you right click on OneNote in the taskbar you will able to see a 'pinned items'.

Here is how to do it:
1. Simple Navigate to the page you want pinned in your File Explorer.
2. Simply drag that down into your taskbar.

Other Posts

Show all posts