Like many who blog I keep a list of topic ideas which I plan to blog about at some point. When I get some time to write I pick a topic that I like the look of and get some word thrashed out. I was surprised when I saw something in last week's MacStories members' newsletter that directly related to something rather niche I had on my list.
As I expect you've already guessed, this post is about that particular topic. It's about getting text to and from the iOS app Drafts from Dropbox.
Dropbox & Drafts
Most denizens of the Internet have heard of Dropbox . The ubiquitous cloud storage platform that made a name for itself early on by providing a service that worked well. Something which really couldn't be said of its competitors. It also solidified itself on Apple's iOS platform by being the one storage service that practically every stop supported.
Drafts is an iOS app that is used for capturing and processing text. It's very much designed around you being able to quickly enter text and then doing one or more things with it afterwards through some level of automated action such as sending it to someone, sorting it, saving it to a file or note, etc. It is a sublimely simple and delightfully powerful application that has all manner of use for both the typical and power user alike.
Where D's Collide
Drafts uses 'actions' to carry out it's text processing activities and as you might expect it is pretty simple to create something that will save some text to a file in a specified location in your Dropbox storage. However Drafts isn't designed to be your familiar text editor. It's designed to serve a different purpose focused on data capture. So opening Dropbox files and saving them back isn't exactly it's forté.
In the MacStories members newsletter #39 I saw a request to do exactly this sort of thing...
"Is there a way to open a text file from Dropbox in Drafts, edit it and svae changes to Dropbox in the exact same file? (Rafal Sobolewski, @Sobolowy)"
The solution authored by the ever primed Federico Viticci was based around using the iOS app Workflow to manage the import and export process and to store the file name in the first line of the draft the file content is imported into. I found this particularly noteworthy as I had done exactly this when I had first looked at using Drafts to edit some files in Dropbox at the start of the year. I also came to the same conclusion ... you can get a lot of the way there, but you can't find the folder location where the file was being picked from.
This was actually the point where I'd left Workflow and gone back to look at Drafts in more detail. Workflow is a hugely capable tool ... but so is Drafts.
Drafts - Draftier than you think...
After a bit of reading and experimentation I found a way to get text into Drafts from Dropbox and back out again just by using Drafts alone ... and here's how I did it.
Open the Drafts app on your iOS device (I'm using my iPhone here) and press on the "+" icon at the top of the screen. Keep pressing the icon until a menu appears. Normally you would just tap on this to create a new blank draft, but when you press nd hold you get more options.
Select Dropbox from the list of the entries shown in the menu.
Navigate to the folder in Dropbox you want to get your text file from. Drafts will allow you to open various types of text based files (not just TXT), but you may need to review your file extension if the file name is dimmed as these can't be selected by Drafts.
Once you've found the right folder and file, tap on the file name to load the content into Drafts.
With the content loaded in you are able to edit and process the text as you see fit.
Once you've finished your edits you will need to open a share sheet for your draft. There are other ways to save content to Dropbox but this is the one I think gives you the best control. I use a "Share Selected" action. This is available to download on the AgileTortoise actions repository for Drafts under the name "Share (selection)".
From the share sheet select, you guessed it, "Save to Dropbox".
Select the save location. With a bit of luck Dropbox might show you it as one in it's recent list. Enter the name of the file. This is one point where the Workflow option can save you a few keypresses, but on the flip side you got to open the file directly and not have to jump out to Workflow to initiate it. You also have the option to save with a different file name if you wish.
By default it is going to try and force a dave with a TXT file extension so depending upon your chosen file extension you may need to tap to override that.
There you have it. Editing Dropbox files in Drafts without the aid of another app or service. You can of course apply this to other storage providers as well as Dropbox ... but Dropbox is the omnipresent grand daddy of cloud storage.
One thing I will say is that whilst I do use Drafts with Dropbox files I don't tend to do much Dropbox file editing in Drafts. I have various writing apps (Editorial, Byword and perhaps another) for writing posts such as this, Taskmator for working with my TaskPaper files, GoCoEdit for my more developer focussed editing. Each of these opens and saves in a more integrated fashion. They're designed to do this. Drafts as I've already discussed isn't. But it can be really useful to bring some of Drafts' automation power to bear on the content of a file so sometimes this is exactly the right thing to do.
I hope you found this useful. If so please leave a comment and/or share and shout out on Twitter where I'm @sylumer.