Documentation for Macro Language is Now Available

October 11, 2014

Macros allow extending OneNote's functionality in a way that was never possible before. Macroland is full of ready to download macros. Many users developed their own macros and published them there. Developing macros may be a daunting task especially since the Macro language wasn't documented at all, except for a few tutorials in this blog.

Today extensive documentation is available for the Onetastic Macro Language here. You can find the link "DOCUMENTATION" above as well. The documentation has following sections:

If you haven't tried building macros before or tried but got stuck due to limited information available, you can give it another try by reading the tutorial and checking out all the reference information.

Happy macro building!

Comments

Name
Comment
mark - 2017-01-29
None of the links are working on this page.
IcyBricks - 2015-10-05
Hi, trying my first macro from scratch. It's a complicated one so I'm building it out in phases, but I cannot get past a "The page is read-only" error message that OneNote is giving me. The only clue I have is that one specific page suddenly gets marked unread after the error (Always the same page, no matter what page/section I have open). This is a shared notebook but I checked with the other authors and I'm the only one with it open. Here is the macro I have so far...why would this error be occurring?

<?xml version="1.0" encoding="utf-16"?>
<Macro name="Collapse Outlines" category="Content" description="" version="10">
  <For each="Paragraph" in="CurrentNotebook">
    <ModifyProp name="collapsed" op="set" value="true" />
  </For>
</Macro>
r2evans - 2015-01-21
Is it possible to initiate a macro from a right-click? Further, can this right-click operate on a single image with the coordinates of the right-click?

What I'd like to be able to do is split an image at the place I right click. I imagine that a right-click (with Onetastic installed) could offer "Split Image at Point" beneath "Crop". (There might be a use-case for differentiating "split horizontally" and "split vertically", though I think the majority use would be to split into the image content above the point and the image content below the point.) This would facilitate "Insert Space" between the two images.

I'm not proficient with Onetastic's macro language, so please bear with my pseudocode (vba-like):

    If (ClickPoint.Object is Image) Then
        Copy thisimg to newimg
        Crop thisimg from top (of shown portion) to ClickPoint.Y
        Crop newimg from ClickPoint.Y to bottom (of shown portion)
        Insert (adding space) newimg below thisimg
    End If

Forgive my gross generalization of the code, but I think it makes the point. What I don't see in the macro language is the ability to (1) trigger on a right-click, (2) get the mouse coordinates relative to the selected image, (3) get the selected image's current crop region, or (4) programmatically crop the image.

I'm inferring that this capability is beyond the intended purpose of the macro language and would likely need to be done in VBA or better (as a UDF or similar). Unfortunately, the Onetastic crop feature doesn't look to be automate-able in VBA, so it would need to be reimplemented.

Thoughts, @OmerAtay?

Other Posts

Show all posts