UpWord Notes x-callback-url API

UpWord Notes allows creating, opening and adding content to files through the x-callback-url specification.

 

URL Scheme

The registered URL scheme is upword://.

 

URL Format

You can use the x-callback-url format:

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

or without the x-callback-url host:

upword://[action]?[x-callback parameters]&[action parameters]

The x-callback parameters are defined by the x-callback-url protocol and are optional for all actions unless specified. If available, these parameters will be called by UpWord Notes. The action parameters are described below.

 

Actions

New

Create a new file in UpWord Notes.

Parameters

  • path: The directory path. If there is none, the root folder of the location is used.
  • name: The filename of the file to create, with extension. If a filename already exists a new one is created. If not specified an untitled file is created.
  • text: The text to insert into the new file.

Examples

Create a new file ‘Test.txt’ in the root with the ‘sample’ text:

upword://new?name=Test.txt&text=sample

Open

Open an existing file. Fails if the file does not exist.

Parameters

  • path: The directory path. If there is none uses the root folder of the specified location.
  • name: The filename of the file to open, with extension. (required)

Examples

Open the file ‘Test.txt’ in the ‘samples’ directory:

upword://open?path=samples&name=Test.txt

Append or Prepend

Append or prepend content to an existing file. If the file does not exist a new one is created.

Parameters

  • path: The directory path. If there is none, defaults to the root folder of the location.
  • name: The filename of the file to open. If the file doesn’t exist it will be created.
  • text: The text to append or prepend

Examples

Append ‘sample content’ to the file ‘Test.txt’ in the ‘samples’ directory:

upword://x-callback-url/append?path=samples&name=Test.txt&text=sample%20content

Prepend ‘sample’ to the file ‘Test.txt’ in the root:

upword://prepend?name=Test.txt&text=sample

Replace

Replace the contents of an existing file. If the file doesn’t exist a new one is created.

Parameters

  • path: The directory path. If there is none uses the root of the location.
  • name: The filename of the file. If the file doesn’t exist a new one is created.
  • text: The text to insert

Examples

Replace the content of the file ‘Test.txt’ with ‘replaced’ in the location and folder being browsed:

upword://replace?name=Test.txt&text=replaced

Search

Search for a string query within a file or entire filesystem. Currently, searches on the entire filesystem matches only file names.

Parameters

  • path: The file path of the file to search in. If there is none or path is invalid, searches entire filesystem.
  • query: The search string

Examples

Searches the contents of the file ‘Test.txt’ for the search string ‘hello world’:

upword://search?path=/Test.txt&query=hello%20world