11. Integration ↑
11.3 Actions for Shortcuts
Notenik provides a number of custom actions that you can use with Shortcuts on Mac.
Shortcuts are available for the Mac starting with macOS Big Sur (version 11).
Note that the shortcuts we’re discussing in this context are different from the keyboard shortcuts that have been available on the Mac from the beginning. The shortcuts we’re discussing here are Apple’s latest take on user-friendly automation scripts that can be composed using a graphical user interface, without having to resort to coding.
The following Notenik custom actions are available for use.
Get Note Title – Returns the title of the last selected Note, from the frontmost Collection. No input parameters needed.
Get Note Sharing Link – Returns a Notenik Custom URL pointing to the last selected Note, from the frontmost Collection. No input parameters needed.
Get Note File Path – Returns the file path pointing to the file containing the last selected Note, from the frontmost Collection. No input parameters needed.
Run Script – Runs a Script File given a path to the file.
Add Note From Text – This action looks for a block of text as input, with the input text formatted following the usual Note File Format. Notenik will attempt to parse the text block in the same way that it would any Note file on disk, and create a new Note, and add it to the last referenced Collection. A useful example shortcut might be made with the following actions.
Ask for
Text
withTitle:
Set variable
title
toProvided Input
Ask for
Text
withBody:
Set variable
body
toProvided Input
Text
Title:
title
Body:
body
Add a Note from a Block of Text
Note that action 1 - 5 in the example above are standard scripting actions, and that action 6 is a custom Notenik action. Keep in mind, though, that the variables can be populated from any source, and that any of the fields available in your Collection can be populated in a similar way.
As with any macOS Shortcut, use the Shortcut Details to specify ways in which you might wish to invoke the shortcut, such as a global keyboard shortcut.
If successful, the
Add Note From Text
shortcut will return a Notenik Custom URL pointing to the just-added Note.
(BTW, thanks to MacSparky for his Shortcuts for Mac Field Guide, and in particular his “Idea Capture” sample shortcut.)
Next: 11.4 Add-Ins for CSS and Javascript