One idea that I had was to submit bite-sized entries as the day wore on. The shorter the update, the less of a burden it would be to write it and the more likely that an entry would happen.
I chose Day One as it's one of the most popular diary apps on iOS and it supports URL schemes (more on this later...)
I chose Day One as it's one of the most popular diary apps on iOS and it supports URL schemes (more on this later...)
So I turned to iOS automation using a combination of the following workflow-based applications:
- Launch Center Pro: This app is used as a central place to go to open other iOS apps and run various actions using URL schemes.
- Workflow: This app takes advantage of iOS 8's sharesheets, with the new ability to send data from one app to another.
- IF (formerly known as IFTTT): This app connects cloud based services with actions local to the phone. It is possible to connect IF with Launch Center Pro (LCP) and run LCP actions from IF.
- Drafts 4.0: This app is a note taking app that support actions. These actions support URL schemes and Javascript.
I must warn you that the following automated workflows may appear to be more convoluted than necessary. I'm sure that there are better ways to accomplish the same thing. This is how I chose to do it.
1) Appending a date and text to a Drafts 4.0 note
Launch Center Pro's action
This URL scheme will prompt you for text, send the text to Workflow, run the "Append to Drafts with Date" workflow and return to Launch Center Pro at the end.- launch://x-callback-url/clipboard?text=[prompt-return:Text]&x-success={{workflow://run-workflow?name=Append%20to%20Drafts%20With%20Date&x-source={{Launch Center Pro}}&x-success={{launch://}}}}
Workflow's "Append to Drafts With Date" workflow
Unfortunately, Launch Centre Pro doesn't have the capability to add a timestamp so I had to rely on Workflow instead. I hear that it may be possible with TextExpander but I chose to use this method instead.- Get Clipboard
- Set Variable
- Variable: Text
- Date
- Use: Current Date
- Format Date
- Date Format: Short
- Time Format: Short
- Set Variable
- Variable: Date
- Get Variable
- Variable: Text
- Add to Variable
- Variable: Date
- Combine Text
- Separator: Custom
- Custom: :
- Add to Draft
- Mode: Append
- Draft UUID: ################
- Edit in Drafts: Off
- Run Action: Off
The idea would be run the Launch Center Pro action whenever I wanted to record a bite-sized entry.
2) Scheduling a Task in iOS
It turns out that it is not possible to schedule a task to run at a specific time on its own. The best solution that I was able to come up with was to use IF (formerly known as IFTTT) to send a notification at a specific time which when opened would trigger the relevant action.
If you know of any other way of scheduling a task, please let me know.
3) Sending Content to Day One
First we start with an action from the IF app.
If the time of day is 11:15pm then run a Launch Center Pro action. In order to run LCP actions from IF, you need to set up a Launch Center Pro account and link it to IF.
IF's Recipe:
- Trigger:
- Every day at
- Time: 11:15pm
- Action:
- Run custom URL
- Which device? (select the relevant iOS device)
- Custom URL:
- workflow://x-callback-url/run-workflow?name=Send%20Content%20To%20Day%20One&x-source=((Launch Center Pro))&x-success=((launch://))
- Notification:
- Push to Day One?
- Sound:
- None
Workflow's "Send Content To Day One" workflow
- Get Contents of Draft
- Draft UUID: ################
- Set Variable
- Variable: Content
- Get Variable
- Variable: Content
- Count
- Count: Characters
- Calculate
- Operation: / (divided by)
- Operand: 3.142
- If
- Input: Contains
- Value: .
- Open Draft
- Draft UUID: ##############
- Edit in Drafts: Off
- Run Action: On
- Action: Export To Day One
- Key: (Leave blank)
- After Success: Nothing
- Otherwise
- Vibrate Device
- End If
Drafts 4.0 "Export To Day One" Action
- Steps:
- 1 step: URL
- Description: Open a URL
- URL Template:
- dayone://post?entry=[[draft]]
- Action Groups:
- 0 groups
- Description:
- Send draft to Day One as a journal entry
- Advanced:
- Confirm before running: Off
- After Success: Default
- Log level: Errors
4) Clearing the Drafts Note after Content Has Been Sent To Day One
If the time of day is 11:30pm then run a Launch Center Pro action.
IF's Recipe:
- Trigger:
- Every day at
- Time: 11:30pm
- Action:
- Run custom URL
- Which device? (select the relevant iOS device)
- Custom URL:
- workflow://x-callback-url/run-workflow?name=Remove%20Drafts%20Content&x-source=((Launch Center Pro))&x-success=((launch://))
- Notification:
- Remove Drafts Content?
- Sound:
- None
Workflow's "Send Content To Day One" workflow
- Get Contents of Draft
- Draft UUID: ################
- Set Variable
- Variable: Content
- Copy To Clipboard
- Get Variable
- Variable: Content
- Count
- Count: Characters
- Calculate
- Operation: / (divided by)
- Operand: 3.142
- If
- Input: Contains
- Value: .
- Open Draft
- Draft UUID: ##############
- Edit in Drafts: Off
- Run Action: On
- Action: Remove All Text
- Key: (Leave blank)
- After Success: Nothing
- Otherwise
- Vibrate Device
- End If
Drafts 4.0 "Remove All Text" Action
- Steps:
- 1 step: Script
- Description: Run JavaScript
- Script:
- var sel = draft.content;draft.content = "";commit(draft);
- Action Groups:
- 0 groups
- Description:
- Remove all lines from your Draft
- Advanced:
- Confirm before running: Off
- After Success: Default
- Log level: Errors
Conclusion
Although it is a little convoluted, this workflow ends up working quite well for me.
Some of the things that I learned during this experiment:
- You cannot schedule an automated tasks on a non-jailbroken iPhone without manual intervention.
- To schedule an automated task, you will need to use IF (aka IFTTT) and Launch Center Pro. A Launch Center Connect account is required (no additional cost and initiated within the LCP app itself.)
- It is possible to add a timestamp and delimiter using Workflow. TextExpander also works apparently but I haven't tried it out.
- Day One doesn't support x-callback-url URL schemes. This means that you cannot chain actions together. Without support for it, the action sequence will always end at Day One. I have contacted their support team and have put in an request for this.
- IF recipes are typically triggered a few minutes after I specify.
- You can only modify text using Javascript in Draft 4.0. The built in options in Workflow and LCP don't allow you to modify content, only add to it.
- It is possible to check for content in a variable using Workflow but the process is not very straight-forward.
That's all for now. Let me know if you have any better ways of going about all of this.