Automate five minute journal DayOne entry with Drafts and TextExpander

drafts
#1

Hey together,

a few episodes into the podcast ‘Focused’ I started to reflect my behaviour. I want to reduce Twitter and RSS use and instead start getting mindful about what I do.

I like ‘The Five Minute Journal’ approach of Joshua Ginter suggested in his blog article ‘Five Ways to Automate Your Day One Journal with TextExpander’.

Created by Chuck Grimmett, these TextExpander snippets are designed to replicate The Five Minute Journal in your Day One.

With this basis I wanted to automate the five minute journal processing for Dayone even further.

For iOS I wanted to use the Home Screen Bookmark shortcut by @sylumer
to create a custom icon to open Drafts, trigger an action inserting the TextExpander abbreviation opening the TextExpander snippets by Chuck Grimmett.

For the Drafts url scheme I thought about:
drafts5://x-callback-url/create?text=&action=Textexpander

The Drafts action contains the utility action “Insert Text”, with the abbreviation <<;5am>> to trigger the Textexpander dialog.

So far drafts is opening and the Textexpander snippet is inserted, but unfortunately not the TextExpander form is called to insert directly the content, but the raw TextExpander text is directly inserted in Drafts. Is there a way that the TextExpander form is presented? If I write the TextExpander abbreviation manually in Drafts, the form is presented.

As last step I would trigger the below action step to add the entry to dayone:
dayone2://post?entry=[[draft]]&journal=Thankfulness

Thanks for further ideas how to reach the goal.

Best
Thomas

0 Likes

#2

If this is just a straight forward text expansion, then it should work just fine to trigger it as you set out with the chevron tags. If it is one that pops up a form that would bump you out from Drafts to TextExpander, then that isn’t going to work. The chevron tags only work for non-interactive expansions as far as I know.

However, if you carry out an x-callback to TextExpander to get an expansion, you could then work with that.

I did a quick test just to prove t to myself…

In TextExpander, a form based expansion I use regularly is for selecting a time code. I trigger it with “tce+” (time code entry). In Drafts I created an action called “textexpandertest”. It has two action steps.

The first is an x-callback URL to the TextExpander iOS app to expand the “tce+” abbreviation.

The second is a text insertion using the template tag that gets populated with the return from TextExpander (‘expansion’).

Triggering this URL…

drafts5://x-callback-url/create?text=&action=textexpandertest

Then opens Drafts, runs the ‘textexpandertest’ action which then opens TextExpander, where I fill out the snippet form.

On ‘Done’, TextExpander returns to Drafts, where the action continues and the expansion returned by TextExpander is inserted into a new Draft; new and empty being expected based on the initial URL that opens Drafts.

Hope that helps.

1 Like

#3

That’s amazing! Thank you very much for the great input - and sorry for coming back so late.

Your suggested solutions works perfect. Together with a third step for sending the text afterwards directly to DayOne, the Journal entry is created real fast.

Step overview:

1st step - Call TextExpander (abbreviation xdam|xdpm):

2nd step - Return from TextExpander:

3rd step - Send to DayOne:

With the help of your above mentioned ‘Home screen bookmark’ shortcut, the below URL for triggering and two icon URL I was even able to create custom icons for calling my DayOne AM and DayOne PM routine with just one tap.

Triggering URL:
drafts5://x-callback-url/create?text=&action=DayOne_AM
drafts5://x-callback-url/create?text=&action=DayOne_PM

Many thanks to @sylumer for the great help and for the automators plattform!

0 Likes