Managing My Reference Material with DEVONthink, OmniFocus and Shortcuts

Reference material is a big challenge, and I find if I don’t set myself up for success from the beginning, then I am most definitely doomed to fail. I found DEVONthink some years ago and really like it for managing my reference material.

I realized a while ago that creating a place to store material related to a project when I create my project is critical—if it doesn’t happen then, when will it happen? As I have a strong tendency to reach for my iPad or my iPhone rather than a Mac, I solved this problem with a little help from Shortcuts and X-Callback URLs!

When you import the shortcut, it asks you for a DEVONthink destination. I keep all of my project material in one database, so I used that as my destination. You could also use a group – or remove the destination components entirely to put everything in the global inbox.

Copy the item link in DEVONThink so you can get the ID for Shortcuts.
Copy the item link in DEVONthink so you can get the ID for Shortcuts.

When you run the shortcut, it asks you for a name, you can cheat and add lots of names though (use a return to separate them), and it will run through each item.

For each one, you can choose if this is a project or a task. For projects, the shortcut automatically creates a group, and for a task, you get the choice of markdown, text, or a group.

The shortcut creates the DEVONthink item first, then creates the project or task in OmniFocus with a link back to the DEVONthink destination in the note. It’s a simple system but works well for me!

You can download DEVONthink And OmniFocus here.




Drafts Action: Fix Empty Markdown Links

As is often the case, as I use Drafts I find things that I need to do and write a script to fix it for me! In this case, I have a habit of planning to add links later in my text, but find it a pain to go through the whole article to find them and the find function is too darn manual for me. There were already a few actions in the Actions Directory, but they didn’t quite work the way I wanted them to. If you haven’t guessed where this is going yet: I wrote my own!

This action using the Script function in Drafts, and some good old regular expressions. The code itself can be broken down into eight steps:

  1. Get the contents of the Draft.
  2. Create the regular expression.
  3. Parse the contents of the Draft with the regular expression to get a list of matches
  4. Create a prompt
  5. Add each match to the prompt
  6. Show the prompt
  7. Go through each match again and replace it (within the whole content) with the information provided through the prompt.
  8. Update the draft.
let content = draft.content; //get the content of the draft

let pattern = /\[[^\]]+]\(\)/g; //build the regex

let matches = content.match(pattern); //find all the empty links

//create the prompt
let p = Prompt.create();
p.title = "Missing Links";

//add each empty link to the prompt
matches.forEach(function (match, index){
    p.addTextField(index, match.replace('[', '').replace(']()', ''), "");
});

//show the prompt
p.addButton("OK");
let didSelect = p.show();

//if the prompt wasn't cancelled
if (didSelect) {
    if (p.buttonPressed == "OK") {
        //go through each empty link and replace it with the updated information
        Object.keys(p.fieldValues).forEach(function (index) {
            content = content.replace(matches[index], matches[index].replace('()', '('+p.fieldValues[index]+')'))
        });
    }
}

//update the draft
draft.content = content;
draft.update();

 

The idea is I can run this at the end of writing, deal with all my links in one prompt, and get on with things. It’s the kind of action I’ll include as a step in other actions to make sure I don’t accidentally post empty links!

Get it from the action directory


Automators 38: Simon Leeb and Pushcut

On this week’s episode of Automators we got to tallk to Simon Leeb, creator of Pushcut. As well as diving into the origins of Pushcut, we also explored Simon’s home automation setup before wandering into the wonderful world of iBeacons!

Automators 38: Simon Leeb and Pushcut. Thanks to our sponsors for this week’s episode: PDFpen from Smile , Flatiron School and Freshbooks.



Keeping Track of My Someday & Maybe Tasks with Git

Someday and maybe tasks and projects are one of those things where I can never seem to find the perfect system. I’ve tried putting these things in OmniFocus and tagging them, using Trello (which I still use, but for different purposes) and I know there has been more than one paper planner over the years!

Some of you may be asking “what is a someday maybe task?”. The name comes from Getting Things Done by David Allen, the idea is something is a task or project you want to do, but you can’t work on it right now – so you put it on a list called “Someday/Maybe” to get around to when the time is right.

A few months ago I turned to Git to try and solve my problem. There were a few features I knew I wanted from a system:

  • Some interoperability with OmniFocus to make it easy to take things out as well as put things back in, or something I could easily script.
  • The ability to track what changed, when, and optionally why .
  • The ability to tweak my system easily without rebuilding it.
  • Automation options.
- [ ] This is a sample task in the format I started with

I started in Drafts, using the task format. This is nice and visual but doesn’t offer all the other features I wanted without setting up lots of actions and cobbling things together. Drafts has versions – which satisfies my want to be able to look back in time, but it lacks explicit change messages connected to these. While Drafts is the right tool for many jobs, it wasn’t quite what I was looking for here.

Next, I did some digging around and stumbled across my old friends BBEdit and Textastic. These are my preferred text-based file editing apps on macOS and iOS, but alone neither of them really hit the spot – until I decided to take some lessons from the professional side of my life and use Version Control.

Version Control systems are designed for programming, so you can track who changed what, when, and assuming they wrote a decent commit message to accompany the change, why. There are quite a few services out there offering these, I chose to use Git and to use GitLab for this. (That said, the sample to accompany this blog post is on GitHub because I know most people are more familiar with that!)

Now, I can make a change to my Someday/Maybe lists from any device, including the web, and just type why I changed it. Version control, in this case, Git, automatically stores what changed and when. You can even do a diff, compare two files side by side so see exactly what was added or removed!

Now it’s time to get into the nitty-gritty! Let’s start with the apps. As mentioned above, on macOS I use BBEdit, this has Git integration so I can theoretically do everything with that. That said, sometimes I switch up my apps so I also have SourceTree around to handle the Git stuff. I could use the command line, but I usually don’t want to. On iOS I use two apps Working Copy and Textastic. There’s good documentation on how to connect the two of them together so I won’t go into detail on that here. To be clear, I use Working Copy for the Git side of things and Textastic for the writing.

Next up: Files. I have two primary lists, Someday and Maybe. Someday is “I really want to do this and will make time for it, but that time is not now”, whereas Maybe is “I like the sound of this”. Projects/tasks stay within these lists until they become unwieldy. If a project has more than 10 tasks that I want to document I create a special list for it. To keep things organised I start these file names with an underscore (_) and then add a note below the task to see that file.

Finally: Format. This took a while to nail down. As I mentioned I started in Drafts so as of when I recorded an episode of Nested Folders 11: Someday/Maybe/Never I was still using - [ ] to indicate a task. This does give you the look of pretty checkboxes – but the point of your Someday/Maybe list isn’t to keep of what you have done, but what you want to do. This means I would never check the tasks off. Instead, I’ve changed to just Taskpaper (at least the elements that OmniFocus uses) as this allows me to copy items over directly when I am ready to do so, and also to export easily.

Now I can update my someday/maybe list whenever I like, across devices, and see what I changed, and when. If you want to see a sample of this check out my GitHub Repository for a sample!


AIRPRESS LOADED