NotePlan
NotePlan combines notes, calendar notes, and tasks. Protocol Launcher allows you to generate NotePlan x-callback-url links for the actions documented in NotePlan's official URL scheme reference.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
Open Note
Open a calendar note, regular note, or note filename.
import { openNote } from 'protocol-launcher/noteplan'
const url = openNote({
noteDate: 'today',
})
const url = openNote({
noteTitle: 'Fleeting Notes#Second Brain',
})
const url = openNote({
filename: 'folder/note.txt',
heading: 'Ideas',
splitView: 'yes',
})Open View
Open a view by name and/or folder.
import { openView } from 'protocol-launcher/noteplan'
const url = openView({
name: 'Project Tasks',
folder: '10 - Projects',
})Add Text
Add text to a note identified by date, title, or filename.
import { addText } from 'protocol-launcher/noteplan'
const url = addText({
noteDate: 'today',
text: '* Hello World',
mode: 'append',
openNote: 'yes',
})
const url = addText({
noteTitle: 'Test Note',
text: '* Hello World',
mode: 'prepend',
})Add Note
Create a regular note with a title and/or text.
import { addNote } from 'protocol-launcher/noteplan'
const url = addNote({
noteTitle: 'New Note',
openNote: 'yes',
})
const url = addNote({
text: 'Hello World',
folder: 'Projects',
highlightStart: 9999,
highlightLength: 0,
})Delete Note
Generate a URL that deletes a note identified by title, date, or filename.
import { deleteNote } from 'protocol-launcher/noteplan'
const url = deleteNote({
noteTitle: 'New Note',
})
const url = deleteNote({
noteDate: 'tomorrow',
})Select Tag
Select a tag or mention. Include the leading # or @; pass an empty string to show all notes.
import { selectTag } from 'protocol-launcher/noteplan'
const url = selectTag({
name: '#noteplan',
})
const url = selectTag({
name: '',
})Search
Search by text or open an existing filter.
import { search } from 'protocol-launcher/noteplan'
const url = search({
text: 'noteplan',
})
const url = search({
filter: 'Upcoming',
})Run Plugin
Run a NotePlan plugin command by plugin name or plugin ID.
import { runPlugin } from 'protocol-launcher/noteplan'
const url = runPlugin({
pluginName: ' Note Statistics',
command: 'nc',
})
const url = runPlugin({
pluginID: 'example.Plugin',
command: 'run',
arg0: 'first',
arg1: 'second',
})Install Plugin
Generate a URL to install a NotePlan plugin by plugin ID.
import { installPlugin } from 'protocol-launcher/noteplan'
const url = installPlugin({
pluginID: 'dwertheimer.Favorites',
})Toggle Sidebar
Toggle, show, or hide the sidebar.
import { toggleSidebar } from 'protocol-launcher/noteplan'
const url = toggleSidebar()
const url = toggleSidebar({
forceOpen: 'yes',
})
const url = toggleSidebar({
forceCollapse: 'yes',
animated: 'no',
})Note Info
Request the absolute file path and name of the currently opened note through x-success.
import { noteInfo } from 'protocol-launcher/noteplan'
const url = noteInfo({
xSuccess: 'sourceapp://x-callback-url',
})x-success
Every documented NotePlan x-callback-url action supports xSuccess.
import { addText } from 'protocol-launcher/noteplan'
const url = addText({
noteDate: 'today',
text: 'Hello',
xSuccess: 'sourceapp://x-callback-url',
})