Quick Journaling - Write stuff in Today’s Journal and act on it later

The short version is that I like the idea of bullet journals, but in practice I’d much rather log things in my phone or watch than with a pen and paper. I also want the things I’ve written to automatically go to my calendar and task manager, instead of having to sit down with a paper journal and manually transcribe them.

This action group lets me easily:

  • Go to Today’s Journal
  • Append the current draft to Today’s Journal
  • Process journal events and send them to Fantastical, OmniFocus, and Day One

I hope someone else finds this to be useful!

Find it at https://actions.getdrafts.com/g/1Sd

9 Likes

I love this!!! Perfect. I usually go to three places at the end of the day. Having one draft go to three places is fantastic. Thanks

You’re very welcome! I’m glad you like it.

1 Like

This is great, I just need to edit to change from Omni Focus to Good Tasks.

Awesome! Once you have that working, could you post the new function here? Then I can add it to a new version for other people.

I released a newer version that makes “Append” a little better behaved:

  • It won’t append a draft to itself and eventually cause a black hole of infinite information density.
  • Appended drafts get “- “ added to the beginning if they don’t already start with “-“, “*”, or “@“.
  • Appended drafts don’t have an extra empty line inserted above them.

Only two changes needed to work with GoodTask:

const ofBaseURL = “omnifocus://x-callback-url/add”;
To
const ofBaseURL = “goodtask3://x-callback-url/add”;
And
cb.addParameter(“name”, line);
To
cb.addParameter(“title”, line);

Works a treat

1 Like

This is really great. Can someone help me please get this with todoist and bear?
Thanks in advance
Inge

I don’t have either of those apps, but if you (or someone else) manages to get it working, I’d be happy to add it.

Today’s version 1.4 adds a human-editable settings file, in the form of a draft named “Quick Journaling settings”. It will be created the first time you run the “Process” action. You can edit that file to select which actions are executed for each journal item’s starting character. Create your own. Delete ones you don’t like. Go wild with it!

This also means that you can upgrade to future versions without wiping out any such local customizations you’ve made. If you set “‘*’ goes to GoodTask” today, it should stay set.

1 Like

Excellent work! I think this really stays true to the spirit of Drafts ‘capture now process later’ strengths.

I have added the necessary lines in your script for Things support for those interested.

My personal preference is to use ‘-’ for tasks (from the TaskPaper camp) so I switched this with ‘*’ for Day One. So I really appreciate your settings file to easily customise that.

Question: I haven't tested this yet, can you tell us if the settings note needs to remain in Inbox, or is Archive fine? I tend to keep a habit of clearing out my Inbox regularly.

Edit: answered myself by testing and see your ‘all’ statement in the file parameter. Settings file can be moved to Archive thanks!

A further improvement I was thinking would be to allow either the next line following a task, or possibly after a separator such as | to be put in the task’s description, I’ve played around with this but can’t get it working with my remedial javascript skills just yet. ‘notes’ would be the parameter name with Things.

Cheers!

Jason


The main script revised:

const lines = draft.content.split("\n");
const dayoneURL = "dayone2://post"
const fantasticalURL = "fantastical2://x-callback-url/parse";
const goodtaskURL = "goodtask3://x-callback-url/add";
const omnifocusURL = "omnifocus://x-callback-url/add";
const thingsURL = "things:///add";

var dayOneLines = [];

// Actions for sending journal entries to various apps

function collectForDayOne(entry) {
	dayOneLines.push(entry);
}

function sendToFantastical(entry) {
	var cb = CallbackURL.create();
	cb.baseURL = fantasticalURL;
	cb.addParameter("sentence", entry);
	cb.open();
}

function sendToGoodTask(entry) {
	var cb = CallbackURL.create();
	cb.baseURL = goodtaskURL;
	cb.addParameter("title", entry);
	cb.open();
}

function sendToOmniFocus(entry) {
	var cb = CallbackURL.create();
	cb.baseURL = omnifocusURL;
	cb.addParameter("name", entry);
	cb.open();
}

function sendToThings(entry) {
	var cb = CallbackURL.create();
	cb.baseURL = thingsURL;
	cb.addParameter("title", entry);
	cb.open();
}



// Resolve actions defined in the settings file to the actual
// functions to call.

var actionMap = {
	"Day One": collectForDayOne,
	"Fantastical": sendToFantastical,
	"GoodTask": sendToGoodTask,
	"OmniFocus": sendToOmniFocus,
	"Things": sendToThings,
}

var actions = {}
for (var key in lineProcessors) {
	var actionName = lineProcessors[key];
	actions[key] = actionMap[actionName];
}

// Process all the lines.

for(var line of lines) {
	line = line.trim();
	if (line.length == 0) { continue; }

	first = line[0];
	rest = line.substr(1).trim();
	if (rest.length == 0) { continue; }

	action = actions[first];
	if (action === undefined) { continue; }
	
	action(rest);
}

// Some actions are processed in a batch after all their entries
// are collected. This is where that happens.

if (dayOneLines.length) {
	var body = dayOneLines.join("\n\n");
	var cb = CallbackURL.create();
	cb.baseURL = dayoneURL;
	cb.addParameter("entry", body);
	cb.waitForResponse = false;
	cb.open();
}
1 Like

Thanks the the kind words, and especially for the Things code! I’ve added it to the new version 1.5 that I just pushed out.

I had a similar thought about having a way to get something into the notes field or adding a due date but my javascript skills are rudimentary so no success…
I have started using these actions to process meeting notes. Any actions and dates are transferred into Goodtask and Fantastical and I have added something to transfer the complete draft into Devonthink, neat.

1 Like

Can GoodTask itself parse the messages if you ask it nicely? For instance, OmniFocus can accept taskpaper formatting and then split that out into the new task’s fields. That to me would be the ideal since it wouldn’t involve reinventing a wheel (if that wheel already exists).

I haven’t been able to get this to work. I’ll see if I can find any other options when I have some time.

This is a super interesting workflow. Is it possible to just create a new draft of the “journal entries”? I’d like to append them to a Dropbox file, for which I already have an action, and don’t mind the extra step.

That’s a neat idea! I won’t have time to add that myself, but it should be easy. The current code collects all of the journal entries into a single variable, then sends that to Day One in one batch. I bet it’d be easy to send that to another Drafts action instead.

1 Like

Thanks, I’ll give it a shot. It looks promising :slight_smile:

Like it very much and am finding it very useful. I want to add a special character and feed to Devonthink. Will let you know if I get it working…

Hot off the presses: version 1.6 has some code cleanups, and also a new widget-friendly “Today I…” action.

1 Like