X-Callback-URL Support


You can make Write an integral part of your automated workflow using the following URL Scheme:

Write App URL Format

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

/note

Create a new note

Parameters:

Examples:

writeapp://x-callback-url/note?title=MyFirstTest.txt&content=test

The above example will create a new file with filename as MyFirstTest.txt and with content as test in the root of your synced folder.

writeapp://x-callback-url/note?title=&content=testingthis&path=/Listacular/

The above example will create a new file with filename as current timestamp and path as:

a. For Dropbox: /< Dropbox Root >/Listacular/

b. For iCloud: /< iCloud Root >/Listacular/


/append

Append content to an existing note

Paramteres:

If blank title is provided:

a. Incase of Dropbox a File Chooser will open

b. Incase of iCloud the action will fail

If blank path is provided:

a. Incase of Dropbox a File Chooser will open

b. Incase of iCloud the root folder will be assumed

Examples:

writeapp://x-callback-url/append?title=Journal.txt&content=Saw%20an%20elephant%20today&path=/Apps/Notes/Journal/

The above example will append the text “Saw an elephant today” to file named Journal.txt at path /Apps/Notes/Journal/

writeapp://x-callback-url/append?title=&content=Saw%20an%20elephant%20today&path=

The above example will open a File Chooser and append the text “Saw an elephant today” to the selected file.

Note: Append will automatically insert 2 new lines before the appended content.


/prepend

Prepend content to an existing note

Paramteres:

If blank title is provided:

a. Incase of Dropbox a File Chooser will open

b. Incase of iCloud the action will fail

a. Incase of Dropbox a File Chooser will open

b. Incase of iCloud the root folder will be assumed

Examples:

writeapp://x-callback-url/prepend?title=Journal.txt&content=Saw%20an%20elephant%20today&path=/Apps/Notes/Journal/

The above example will prepend the text “Saw an elephant today” to file named Journal.txt at path /Apps/Notes/Journal/

writeapp://x-callback-url/append?title=&content=Saw%20an%20elephant%20today&path=

The above example will open a File Chooser and prepend the text “Saw an elephant today” to the selected file.

Note: Prepend will automatically insert 2 new lines after the prepended content.


/content

Fetch content of a particular file and copy content to Clipboard or pass to x-success.

Parameters:

If blank title is provided:

a. Incase of Dropbox a File Chooser will open

b. Incase of iCloud the action will fail

If blank path is provided:

a. Incase of Dropbox a File Chooser will open

b. Incase of iCloud the root folder will be assumed

Note: To pass content to x-success callback use [content] as parameter in the x-success callback url. [content] will be automatically replace by the file’s content.

Examples:

writeapp://x-callback-url/content?title=Journal.txt&path=/Apps/Notes/Journal/&x-source=LCP&x-success={{drafts://x-callback-url/create?text=[content]}}&x-error=launch://

The above example will fetch the contents of file named Journal.txt at path /Apps/Notes/Journal/ and pass the contents via x-success to Drafts app. Incase of an error it will go back to the source app, in this case Launch Center Pro.

writeapp://x-callback-url/content?title=Journal.txt&path=/Apps/Notes/Journal/

The above example will fetch the contents of file named Journal.txt at path /Apps/Notes/Journal/ and simply copy its contents to the clipboard.

writeapp://x-callback-url/content?title=&path=

The above example will show a File Chooser, fetch the contents of the file your selected and copy them to the clipboard.


/action

Creates a temporary note and fires a pre-defined action or x-success-url.

Parameters

Blank title will use the current timestamp as file name

If no content is provided, clipboard’s content will be used

If no action is specified but an x-success parameter is specified, the x-success url will be called.

If no action is specified and no x-success parameter is specified, the action will fail.

If no afterSuccess value is provided, the file will be discarded on firing action.

Examples:

writeapp://x-callback-url/action?title=&content=Test%20Document&actionName=Export%20as%20PDF

The above example will create a temporary note with content as Test Document and call the action titled “Export as PDF” and present you with a sheet with compatible PDF reader apps on your device to open the PDF in. The note will then be discarded.

Chaining multiple url actions to automate:

fantastical2://x-callback-url/parse?sentence=[[line1]]&x-success={{writeapp://x-callback-url/action?content=[[content]]&x-source=Fantastical&x-success={{due://x-callback-url/add?title=[[line2]]&x-source=Write&x-success={{writeapp://x-callback-url/action?title=&content=[[content]]&x-success={{clearapp://list/create?listName=[[line3]]&tasks=[[line4]]}}}}&afterSuccess=delete}}}}

The above example is inspired by @the_buch

It will save an event in Fantastical, create a reminder in Due and finally create a task to your specified list in Clear. All this without creating any clutter in your document list since it won’t save multiple copies.

Action Format:

Event or reminder to be parsed in Fantastical.
Reminder to be added in Due.
Name of list in Clear.
Task to be added to said list in Clear.

The 1st line of the note will be used to add an event in Fantastical.

The 2nd line of note will be used to add a reminder in Due.

The 3rd line of note specifies the List name in Clear.

The 4th line of note specifies the task to be added to list name specified in line 3.