iOS Shortcuts

Apple’s Hidden Pot Of Gold

Two days ago I found myself hip deep in IFTTT settings, in their Button Widgets trying to find a way to make individual posts to my work log in my journal software, Bear.app.

I keep two tracks of logs, and they both share similar structures. I have a Personal Log, and a Work Log. They look like this in Bear.app: “August 7, 2021 – Personal Log” and then have space below where I journal my day. Usually I find myself forgetting to actually write anything and so I have days that go by where there is nothing in there. Sometimes I’ll turn to my Signal app, try to scroll back and see what I was posting to all my friends in our group Signal chat, and use that to help me remember. I’ve been wanting, for the longest time, a way to press a button and enter quickly some commentary, and then have it associated with a timestamp for me and added to my Bear log.

This all started with IFTTT. I know that Bear.app doesn’t have any connectivity to IFTTT, but Remember The Milk does, so I thought I could use IFTTT to write journal entries into RTM, and then at least I’d have them captured so I could eventually copy and paste them into Bear.app. It wasn’t elegant, but it was a workaround that could work. As I was looking around Google seeing how other people did things like this, I started noticing some references to Shortcuts. I had always thought of Shortcuts as this kind of Siri-linked simple tinker toy thing, Apple’s way of getting Siri to be more than it is. How wrong I was!

Turns out that Shortcuts has it’s own programming language, access to a shocking amount of iOS functionality that I previously never thought Apple would willfully reveal to end users, in the iOS platform, and the answer to this particular need of mine. This is how I did it.

It all starts inside the Shortcuts app. Older versions of iOS didn’t include this by default, but since iOS 13, I think, Shortcuts has been a stock app preloaded on every iOS device. Tap on Shortcuts, then create a new Shotcut, and here’s the screen shots:

The first item was to “Get A Variable” from the Scripting group. This lets you pick “Current Date” and if you press there, you can pick the format of the timestamp. I wanted a simple short time-only stamp, so setting Date to None was the key.

The “Text” object was next, from the Documents group. I don’t know why I needed it, but I think it draws the variable into the scope of the rest of the project.

Then “Ask for Input” from the Scripting group presents a small dialog box so you can type in whatever entry you like.

Next I created a new Text object, with the text I entered from the Scripting object. This is how I introduced a hyphen between the time entry and the text entry, formatted the way I wanted in my Bear journal entry.

Some apps have Shortcut-enabled controls provided to the system, in this case, Bear definitely has a lot of controls available. I was gratified to see an append-to-note function, so I added it to my Shortcut. This particular control creates a Bear entry for the entire day, gives it a special name, “Work Log Inbound” so that when I am in Bear, I can just copy and paste items from the Inbound daily item into my real work log bear entry, then throw away the “Work Log Inbound” entry.

After a short while of using this shortcut, which works really well, I must admit, it struck me that sometimes, not all the time, but I would like to maybe share my journal entry in Signal, or maybe email it, so the “Copy to Clipboard” from the Sharing group works really well. I can just ignore it, but if I want to add my journal observation to Signal, it’s waiting for me in the clipboard.

The Shortcut in the first iteration left me in Bear app. I didn’t want that. I wanted a “quick journal entry and back to the home screen” turns out, this home screen is technically called “SpringBoard”. There used to be a “Exit to SpringBoard” control in the Beta version of Shortcuts, but Apple removed it. Someone figured out a hack. The trick is to create a Shortcut to open something innocuous, like Notes, then save it as a plist file, then change it textually to force it to work for SpringBoard. Right now in iOS 14.7.1 this works, but it might break if Apple decides to be grumpy about it.

I created a duplicate Shortcut to this, called it “Personal Log” and it pretty much follows along. But that was easy since my work log and my personal log are pretty much parallel with each other in Bear. One small thing to note, this is only for basic text, there are no frills or extra neat bits, it just bangs in text chunks by button, nothing more, nothing less.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.