Dropbox is indispensable on iOS. Apps like 1Writer with it’s support for creating folders and Launch Center Pro for iPhone which supports browsing your Dropbox and opening files are ready make working on your files a bliss.
Usually working with these apps is enough, but when I have a longer writing project I’d like to have a shortcut to open that particular file in my editor of choice and if I’m done I’d like to sync the changes back. It’s definitely faster if 1Writer isn’t your default editor and the text file is in another location than the one you specified in your default editor.
So, let’s keep this short and sweet and show you these two very simple x-callback-url’s which work as a manual sync solution for single files:
Requirements: Drafts and Launch Center Pro.
Fetching a Note
UPDATE: As it turns out my URL scheme to pull a note from Dropbox with Drafts is serpentine. It’s now officially filed away under “The U-Turn”
Thankfully Phillip Gruneich - who has a deeper understanding of URL callbacks than I do - showed me a shortcut which I’m going to share here:
Version 1 – Launch Center Pro:
Version 2 - Drafts:1
That’s it for part 1.
Dear reader, feel free to skip the U-turn subsection since it only documents how to complicate things. To jump right to part 2 press here with your mouse or finger now.
(1) We use Lauch Center Pro’s new Dropbox action the specify the file whose content we want in our clipboard (here “iOS Automation.md”).
Just use Launch Center Pro to create the URL and it takes care of percent encoding it for you. Result:
(2) Next we tell Launch Center Pro to open the clipboard as a new draft in Drafts.
Optionally, if you don’t want to edit the file in Drafts you could use an action which sends the text to the app of your choice. I stick with drafts since I think it’s an excellent editor.
The resulting decoded URL scheme:
Complete URL scheme (encoded):
For the passing on the clipboard it’s necessary to encode the second part of the URL like outlined in the Launch Center Pro documentation. Thankfully the app also has the capability to do that for you (see LCP’s clipboard actions).
Pushing the edited Note
This has become very easy thanks to the latest Drafts update which features a replace function – no more need to bring the heavy tools (Pythonista) to the game.
Open up drafts, create a new Dropbox action that looks like this:
Certainly not elegant or unique, but I happen to find it useful.
I need to fix the code block issues with my Markdown parser. It wouldn’t display the code for the URL scheme properly. That’s way you see this nice tweet from Phil. ↩