Setup: Drafts on iOS with Working Copy

Setup: Drafts on iOS with Working Copy

NOTE:
This does not cover git basics!

NOTE:
I do own the subscriptions both to Draft and Working Copy.
It is hard from me to evaluate if both are necessary.
But I would strongly suggest your support of these two amazing developers and their great applications.

Versions:

  • Drafts: latest / v24.1
  • Working Copy: latest / v4.4.7

Drafts File Structure

Drafts has, in addition to its local storage, an iCloud folder.
As in my setup with iOS and macOS devices I only use iCloud.

Working Copy Setup Synced Folder

  • Preparation:

    • Install or update Drafts
    • Sync / Download all files in the Drafts iCloud folder
    • Install or update Working Copy
    • Go Online
  • Setup:

    • Open Working Copy
    • Go to the root folder or into the folder you want to put the synced Drafts Files
    • Add a synced folder and name it to your liking
    • Start the syncing of the files and folders
    • Commit files (for example setup, first setup)
    • OPTIONAL: Add remote for repository
    • REPEAT this on your other iOS devices
  • Test:

    • Add a file from Files App
    • Add a file from Drafts App
    • Add a file from Working Copy App
    • Use your different devices to check it
3 Likes

Many thanks. This has gotten me thinking about actions that can take advantage of Working Copy’s extensive automation to e.g. automatically commit a Draft to a specific repo. The tricky design point is what repo / folder to associate a given draft with - maybe a folder per workspace would work.

I’ve actually done a truly staggering amount of work with this over the last few months, :slight_smile: and there’s definitely a blog post coming sometime once I sort a few of the ways I do things out a bit more, but here’s a few experiences.

First, if you do a lot of this, you’re better off to write a shortcut that you run periodically, in my case daily, to process the Drafts. I found it really irritating jumping back and forwards between Drafts and Shortcuts every time I needed to update something.

As for where, well as you say you need to have some rules. mine are basically, if it has a journal tag, it goes in my journal folder. If it has a notes tag, it goes in my notes folder. And if it has a path line, it gets put in that folder with the Draft title as the file name.

The path lineis the only tricky one. It’s basically the result of importing my old system into Drafts, and some things just have to go in certain places. So, usually at the end of the Draft I’ll have a line that looks like
#path Resources/Productivity/xxx.md
where xxx is the Draft title. I’ve got an action to create these.

I’m even testing a system that looks at the trash folder for the day and deletes the files for the day if they meet the same criteria, so that I can actually move files or delete them in working copy if I have to. To do that, I’m using the beta version of Toolbox Pro that lets me delete files from a bookmarked folder.

yes, in case you were wondering, I’m insane. It does work pretty well once you set it up, though.

4 Likes

Sorry I do not get what this is.

My post uses synced folders from working copy. I do not see the need for a shortcut there.

But I am sure I got this wrong.

@technodad If you are planing to export draft contents to the iCloud folder of drafts you could put folders in there easily. The export should be straight forward. Afterwards in working copy: sync, add, commit and push.

I am wondering if I should hint you to make your repository folders as sub modules. that might be a powerful solution if you are willing to learn a bit about git submodules.

Ask me for clarification if necessary

1 Like

Sync’d directories should means that you can save drafts to file in Drafts’ iCloud area, and have those automatically picked up and available in a local repository in Working Copy.

The use of Shortcuts isn’t taking advantage of this powerful feature, but it is enabling automatic, periodic export; so there is potentially a use there which does not overlap with the sync’d directories. i.e. It would be a way of working around automated saving given that Drafts is not editing files in directories.

I think that the two can be set-up to complement each other nicely if both are beneficial to someone.

One suggestion i might make is that rather than adding a path line into a draft, you could store it as custom metadata to keep the draft content clean.

3 Likes

Ok that is obviously so.
But that also might give the problem of managing multiple versions (inside and outside of drafts)

Or am I missing something?

If you have content updates outside of Drafts, then yes, but that is a challenge of using Working Copy with Drafts, not making use of Shortcuts. Git would be the way you would resolve any conflicts, so presumably you wouldn’t be forcing say a remote overwrite arbitrarily.

Ah, I think there is a bit of a misunderstanding here.
My idea and usage is to work with the already external files in /Library/Scripts, /Library/Template and /Library/Preview

and to manage them via git.

1 Like

Yes, @yvonnezed was referencing the use of draft content - specifically processing drafts.

kind of hijacking my nice thread …

:stuck_out_tongue_winking_eye:

Sorry about that. Not an intentional hijacking, more like misunderstanding what you were referring to.

As for the path thing, I could use metadata, but that kind of makes it invisible to Shortcuts, which wouldn’t be very helpful. Also, it was something I used before for another reason, so I just continued it for this one, the perils of importing from a previous notes system.

And finally, as for going the other way from Working copy to Drafts, I generally don’t at the moment, so haven’t worked out a system for that. What I’d probably do would be to write yet another Shortcut and look at Working Copy commits or something. Use the same rules on each file of a Working copy commit, but add to Drafts or update. Again, that’s just off the top of my head, I haven’t tried it yet.

1 Like

Do not be sorry I think you replied to technodads idea and the combination of your and my thought is golden.

Yesterday I started to experiment with a simple shortcut calling an drafts action (a java script action) to do some maintenance (exporting and so on) on connecting my iPhone to the power plug (mostly at night)

I thinks a good idea is to keep the shortcut as small as possible. (but that is based on the fact that I am able to do script in Drafts)

I am still testing with the action and the shortcut but I think that we even could add a call to working copy after generating some files into the synced folder.

This might be a great way to backup to a git server.

thank @yvonnezed, @technodad and @sylumer

2 Likes

The point was that it is accessible to Drafts and Drafts is doing the exporting to a synced folder structure. Shortcuts would have been the trigger, not running the logic, that’s in a Drafts action. :wink:

1 Like

I can’t see why it wouldn’t work. The Working Copy Shortcuts actions are pretty bullet proof by now,. About the only thing you’d probably have to be a bit careful of is that the iOS device is unlocked when you run the automation, but you probably have to do that for Drafts actions anyway.

Ugh, I actually hate triggering Shortcuts actions from Drafts or Drafts actions from Shortcuts unless I absolutely have to. I don’t really like the switching backwards and forwards between apps, which is why I ended up batch processing the Drafts in the first place. Part of that might be this poor original iPad pro showing its age, I’m not sure, :slight_smile: .

I’m vaguely hoping that at some point the new shortcuts features might let Greg call Drafts actions without switching, which might make the flow a bit nicer and let me use more Drafts actions from Shortcuts.

1 Like

I’m with you on this @yvonnezed: Original 12.9” iPad Pro that can otherwise perform according to my needs. And also batching requests to avoid boundary crossings between Shortcuts and A.N. Other app would be my preferred style under the circumstances.