Workflow and Trunk Notes
Workflow is a fantastic app, recently acquired by Apple, which allows users to create their own iOS mini apps. It is a great way of automating common tasks and adding custom functionality to your iPhone.
In this blog post we are going to use Workflow to create Today Widgets to:
- Open a specific Trunk Notes page
- Quickly capture some text and append it to a Trunk Notes pages
In order to follow this blog post get started by installing Workflow onto your device - it’s free. You can download it from the App Store.
The main screen in Workflow is a list of all your workflows. Just tap the + button to add a new workflow.
You’ll first be asked what kind of workflow you want to create - normal (i.e. run from the Workflow app), Today Widget or Action Extension. We will be choosing Today Widget.
The next step is to add the actions which make up the Workflow. To do that you can either swipe from the left side of the screen, or tap the Actions tab bar button.
Once you’ve got the list of actions you can browse from the list of suggested actions. For our workflow use the search bar and type Url.
Add the Url action by dragging it to the right hand side of the screen and dropping into your new Workflow - for now it will be the only action.
To open a specific page in Trunk Notes you need to use the Trunk Notes URL scheme. To open a page it’s simply tn:// followed by the name of the page. For example to open your HomePage:
Write the URL to open the page you want into the space provided.
Next you need to add the action Open X-Callback URL. Your Workflow should now look like this:
Before you’ve finished you should give the Workflow a name, it will currently be called Untitled Workflow and configure its icon. Just tap the cog icon to do this.
In order to see your Today Widget:
- Swipe down from the top of the screen to reveal the notification center
- Swipe left to get to the Today view
- Scroll to the bottom and tap Edit
- Add Workflow
You can now tap your newly created Workflow with a few simple swipes no matter which app you have open and be shown your favourite Trunk Notes page!
Now you’ve got something simple up and running lets take advantage of the enhanced URL scheme added to Trunk Notes 4.5.0.
Start a new Workflow and add the actions:
- Ask for Input
- Set Variable
- Add to Variable
- Open X-Callback URL
Lets break these down and how you need to configure each of these.
Ask for Input - set the question to be something like “Quick note” and make sure that Input Type is set to Text. This will pop up a text area for you to type the text you want to quickly add to Trunk Notes.
Set Variable - enter the variable name Text. This will save the text the user was asked to enter into a variable called Text. We can use these later on in our workflow.
Text - in here just add a blank line, that is press the Return key. We will need this text so that all of your quick notes don’t end up on one line.
Add to Variable - set the variable as Text. This will add our blank line to the end of the entered text.
URL - set this to tn:///append?page=QuickNotes&content=Text. Use the bar that appears above the keyboard to select your variable Text. Change QuickNotes to the name of the Trunk Notes page you want to add your quick note to.
Open X-Callback URL - this opens the URL we just constructed and will get Trunk Notes to append your entered text to the page you specified.
Here are some screenshots showing how your Workflow should look:
Hopefully you can see how powerful the combination of Workflow and Trunk Notes can be. If you create any interesting Workflows why not tell other users about them in the comments below.