X-Callback-Url Scheme

In this article:


General scheme:

noteplan://x-callback-url/[action]?[action parameters]&[x-callback parameters]

/openNote

Open a note identified by the title or date.

Parameters:

  • noteDate optional to identify the calendar note in the format YYYYMMDD like '20180122' or use 'today', 'yesterday', 'tomorrow' instead of a date.
  • noteTitle optional to identify the normal note by actual title.
  • fileName optional to identify a note by filename instead of title or date. Searches first general notes, then calendar notes for the filename. If its an absolute path outside NotePlan, it will copy the note into the database (only Mac).
  • subWindow optional (only Mac), values: yes (opens note in a subwindow) and no

Example:

noteplan://x-callback-url/openNote?noteDate=20180204

/addText

Adds text to a note identified by the title, filename (normal notes) or date (calendar notes).

Parameters:

  • noteDate optional to identify the calendar note in the format YYYYMMDD like '20180122' or use 'today', 'yesterday', 'tomorrow' instead of a date.
  • noteTitle optional to identify the normal note by actual title.
  • fileName optional to identify a normal note by filename instead of title or date. Searches first general notes, then calendar notes for the filename (strings for dates can be also used here like for the noteDate attribute).
  • text text to be added to the note.
  • mode optional, values: prepend, append
  • openNote optional, values: yes (opens the note, if not already selected), no
  • subWindow optional (only Mac), values: yes (opens note in a subwindow if 'openNote' was also added as argument with 'yes' value) and no

Examples:

Calendar notes:

noteplan://x-callback-url/addText?noteDate=20180204&text=*%20Hello%20World&mode=append&openNote=yes

Use noteDate to target calendar notes.

Project notes:

noteplan://x-callback-url/addText?noteTitle=Test%20Note&text=*%20Hello%20World&mode=prepend

Use noteTitle to target normal notes.

/addNote

Adds a new note with text and a title. If the title already exists, it still creates a new note and appends a number to the filename. If you want to add a calendar note, use "/addText". The calendar notes are automatically created for you and there can't exist multiple calendar notes for one date.

A new note should have either a title or a text. Empty notes are not allowed.

  • noteTitle optional, will be prepended if it is used
  • text optional, text will be added to the note
  • openNote optional, values: yes (opens the note, if not already selected), no
  • folder optional, define which folder the note should be added to. The folder will be created.
  • subWindow optional (only Mac), values: yes (opens note in a subwindow) and no

Example:

noteplan://x-callback-url/addNote?noteTitle=New%20Note&openNote=yes

/deleteNote

  • noteTitle title to identify a normal note
  • noteDate date to identify a calendar note in the format YYYYMMDD like '20180122' or use 'today', 'yesterday', 'tomorrow' instead of a date.
  • fileName optional to identify a note by filename instead of title or date. Searches first general notes, then calendar notes for the filename.

Example:

noteplan://x-callback-url/deleteNote?noteTitle=New%20Note

/selectTag

  • name required tag name, leave it empty to show all notes.

Example:

noteplan://x-callback-url/selectTag?name=noteplan

  • text required to identify the search string, leave it empty to clear the search field.
  • view optional, values: notes (notes view is default if not set), calendar (set the search field of the calendar view), note (set the search field of the opened note)

Example:

noteplan://x-callback-url/search?text=noteplan&view=calendar

/noteInfo (x-success)

This only works with x-success and is to get the absolute filepath and name to the currently opened note.

Result parameter:

  • path absolute file path to the opened note file.
  • name name of the opened note.

Example:

noteplan://x-callback-url/noteInfo/?x-success=sourceapp://x-callback-url

Result (NotePlan will call):

sourceapp://x-callback-url?path=[html encoded file path]&name=[note name]

Where the parameters in square brackets are replaced by the actual path and name, both html encoded. Replace "sourceapp://x-callback-url" with the x-callback-url link of the app you want to call or the source app from where you call it.

Testing

Run the X-Callback-Url like this in the Terminal to test:

open "noteplan://x-callback-url/addText?noteDate=20180204&text=Hello%20World"

Or enter the URL into Safari or another browser.