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
- path optional The path to the folder in which you want to create the document.
- name optional The name for the document.
- text optional The content for the document. If not specified, the content of the clipboard will be used.
Examples
-
onewriter://x-callback-url/create?path=Dropbox%2FDocuments&name=Notes.txt&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
- path optional The path to the document.
- text optional The 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
- text required The replacement text.
content
Returns content of a document.
Parameters
- path optional The path to the document.
- param optional The content will be passed to the x-success URL using this parameter name. Default value is "text".
Example
-
onewriter://x-callback-url/content?path=Dropbox%2FDocuments%2FNotes.txt
Returns content of the document at "Dropbox/Documents/Notes.txt".
open
Opens an existing document.
Parameters
- path optional The path to the document.
Example
-
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
- path optional The path to the document.
- text optional The content to append. If not specified, the content of the clipboard will be used.
Example
-
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
- path optional The path to the document.
- text optional The content to prepend. If not specified, the content of the clipboard will be used.
Example
-
onewriter://x-callback-url/prepend?path=Dropbox%2FDocuments%2FNotes.txt&text=Hello%20world
Prepends "Hello world" to the document at "Dropbox/Documents/Notes.txt".