URL Scheme
1Writer registers the onewriter://
URL scheme and supports for integration with other apps via the x-callback-url protocol. The format for a URL action looks like this:
onewriter://x-callback-url/[action]?[action parameters]&[x-callback parameters]
Supported x-callback parameters: x-success
, x-error
and x-cancel
.
1Writer supports the following actions:
/create
Creates a new document.
Parameters
- pathoptionalThe path to the folder in which you want to create the document.
- nameoptionalThe name for the document.
- textoptionalThe content for the document. If not specified, the content of the clipboard will be used.
Examples
onewriter://x-callback-url/create?name=Notes.txt&path=Dropbox%2FDocuments&text=Hello%20world
Creates a new document with name Notes.txt in the folder Dropbox/Documents, its content is Hello world.
onewriter://x-callback-url/create?path=iCloud%2FWork
Creates a new document in the folder iCloud/Work, its content is get from the clipboard.
/replace
Replaces content of a document.
Parameters
- pathoptionalThe path to the document.
- textoptionalThe new content for the document. If not specified, the content of the clipboard will be used.
Examples
onewriter://x-callback-url/replace?path=Dropbox%2FDocuments%2FNotes.txt&text=Hello%20world
Replaces content of the document at Dropbox/Documents/Notes.txt with new content: Hello world.
onewriter://x-callback-url/replace?path=iCloud%2FWork%2FActions.txt
Replaces content of the document at iCloud/Work/Actions.txt with the content of the clipboard.
/replace-selection
Replaces selected text in the current editing document.
Parameters
- textrequiredThe replacement text.
/content
Returns content of a document.
Parameters
- pathoptionalThe path to the document.
- paramoptionalThe content will be passed to the
x-success
URL using this parameter name. Default value istext
.
Examples
onewriter://x-callback-url/content?path=Dropbox%2FDocuments%2FNotes.txt
Returns content of the document at Dropbox/Documents/Notes.txt.
/create-todo
Creates a to-do list by separating lines of the text
parameter. You can start a line with "+" to indicate a completed todo.
Parameters
- pathoptionalThe path to the folder in which you want to create the document.
- nameoptionalThe name for the document.
- textoptionalThe content for the document. If not specified, the content of the clipboard will be used.
Examples
onewriter://x-callback-url/create-todo?path=Dropbox%2FShopping&text=Milk%0AEggs%0AChocolate
Creates a new to-do list in the folder Dropbox/Shopping, its items are Milk, Eggs and Chocolate.
/open
Opens an existing document.
Parameters
- pathoptionalThe path to the document.
Examples
onewriter://x-callback-url/open?path=Dropbox%2FDocuments%2FNotes.txt
Opens the document at Dropbox/Documents/Notes.txt.
/append
Appends content to an existing document.
Parameters
- pathoptionalThe path to the document.
- textoptionalThe content to append. If not specified, the content of the clipboard will be used.
Examples
onewriter://x-callback-url/append?path=Dropbox%2FDocuments%2FNotes.txt&text=Hello%20world
Appends Hello world to the document at Dropbox/Documents/Notes.txt.
/prepend
Prepends content to an existing document.
Parameters
- pathoptionalThe path to the document.
- textoptionalThe content to prepend. If not specified, the content of the clipboard will be used.
Examples
onewriter://x-callback-url/prepend?path=Dropbox%2FDocuments%2FNotes.txt&text=Hello%20world
Prepends Hello world to the document at Dropbox/Documents/Notes.txt.