Automation


Automation

Automate Rotating Wallpapers on iOS

29th November 2020

In iOS/iPadOS 14.3, a long awaited Shortcut action will return. The 'Set Wallpaper' action. Couple this with the automation feature of Shortcuts, and you can build something simple, but very fun. It's still in beta right now, so if you're running the public release you will unfortuantely have to wait just a bit longer.

But for people that are running 14.3, you can make use of these two shortcuts I've created that rotate your wallpaper.

The Shortcuts

The first one simply looks in an album for photos, gets a random one, and sets it as the wallpaper. So you can just add/remove photos from the selected album, and let the shortcut pick it up.

The other is a bit smarter, as it has the option to choose a seperate for light and dark backgrounds. so depending on the current appearance that is set, it will choose from a seperate group of photos.

I was stuck for a while with this one, since there is no built-in action to check whether dark mode is currently enabled. Luckily, Alex Hay (developer of Toolbox Pro) shared with me a way to determine this inside a shortcut using JavaScript. Turns out there is an action from Toolbox Pro that can do this, but I thought I’d keep this shortcut from requiring any third-party apps.

To use the shortcuts, you will need to specify the albums before you run them, but apart from that they're ready to go.

Download

Automation

While these shortcuts will change your wallpaper, the magic comes in the automation. Using the Shortcuts app, you can use various triggers to run a shortcut. I haven't found a way to pick a time interval to have it automatically repeat, but you can just pick certain times of the day and have them each trigger the sa me shortcut.

I've just gone with a simple trigger of sunset every day, because I don't personally want it changing all the time. But having a new wallpaper every day seems good.

What I would like in the future, is if you could trigger an automation based on dark/light mode being toggled. Or if you could somehow create one of the adaptive wallpapers that switch between light/dark mode automatically.

When making an automation, make sure to disable ‘Ask Before Running’, otherwise you will need to okay it every time it runs.

Building a Habit Using Money and Automation
Personal

Building a Habit Using Money and Automation

3rd November 2020

I came across an interesting blog post today, where Matt Brunt set up an integration between IFTTT and Monzo (a UK bank) to help save money. So that every single time he tweeted, 20p would be transferred into a separate pot on his Monzo account, which itself would be locked away until just before the PS5 release date.

As soon as I read the article, I was instantly struck with ideas on how I could make use of a similar integration.

My Situation

Personally, I don't have a big problem with being able to save money. I have a structure to my savings, and I'm very strict with myself to make sure I separate a portion of my wage every time I am paid.

What I do have a problem with is choosing when to spend money. I mean to say I have so much money I don't know what to do with it. I wish. But in general, I have a problem associating value to a purchase. For example, I purchased an iPhone 12 not long ago, but I probably wouldn't spend over £15 on a t-shirt, or even £60 on a pair of shoes. Whereas there are a lot of people that see enough value in a pair of shoes to spend quite a lot of money on them.

I tend to place a higher value on computers, whether it be a smartphone, tablet, or real computer. The main reason is that it's what I'm interested in. But I also use these products as tools in my life, and also to get work done. I use these products to develop apps, write for this blog, and the usual stuff like gaming and social media.

You'd think I'd be fine spending money on new iPhones, iPads, and Macs. But instead, the "normal" part of me usually decides that a new device probably isn't worth it, since a lot of times the current device can cope with what I'll end up doing on it. It's the reason why I own an iPad Pro 10.5", even though I've been wanting a 12.9" pro ever since they were available. I must admit, I was close to buying the model that came out earlier this year, but it didn't seem like a big enough update to force my hand.

But I still have that constant thought in my head that I need that 12.9" iPad Pro, and especially the new Magic Keyboard. Although to be fair, I don't need it, no-one needs an iPad. I want it, for quite a few reasons, but that's not relevant here (I've already dragged this out too far anyway). Let's now get to the point.

The Goal

There would be no point of all this fuss if I didn't have some kind of goal, or to be specific, an amount of money I want to save. So the goal I'm setting myself is enough to buy a 12.9" iPad Pro (I guess that should be obvious by now). The model I want will be around £1000 I reckon, so that will be my target.

Alongside the iPad, I will also want the Magic Keyboard to do my writing on. But I'll leave that as a secondary goal to do after if this one goes well.

My Theory

In the article by Matt Brunt, he set up an automation as a fun way to put some money away. But I've also seen other people in the past use it as a punishment, where they track some performance metric, and if they don't hit it then some money gets donated to charity (or somewhere else). Or others that use it for saving may use an environmental action to trigger the saving, something like every time it rains, a tiny bit of money is saved for a future holiday.

I have a theory that this automated saving technique could be used as an incentive, rather than something negative. Instead of punishing bad behaviour by putting money away, I plan on rewarding good behaviour by allocating money towards something I want to buy.

In this case, the reward will be buying an iPad Pro for myself, and the behaviour I want to use as the trigger will be publishing blog posts.

To me, this seems like a perfect fit. I want to get myself into a habit where I'm writing at a good pace, and regularly publishing to my blog. And I'd really love to eventually be doing that on the big iPad. So while I'm building up a habit, I'm also going to use this experiment as a way to prove to myself that I do actually want to write "long-term" and it's not just an occasional hobby.

The Automation

For the automation, I'll be using a combination of the blogs RSS feed, IFTTT, and a specific pot in Monzo with an associated goal (Which has a cool image that I built using Robb Knight's tool, and is the featured image of this post).

It's a pretty simple process. Whenever there's a new item in my blogs RSS feed, money will be transferred into my pot in Monzo. Eventually, I'll hit the target, I'll order the iPad, and all my life's worries will go away (I think this is how it works?).

I've chosen the amount to be £1 per blog post, so it's pretty easy to calculate how many I'll need to publish before hitting my goal. 1000.

I had an idea on somehow basing the amount on the length of the post, or if it's a simple link post, but I think if I add to complex I probably won't ever complete it.

Anyway, this post will serve as the first out of 1000, and will fortunately/unfortunately cost me £1. Which means I've now got to go and write and publish another 999! Wish me luck.

Automation

Delaying My Washing With Shortcuts

6th August 2020

A bit of a weird headline, I know. However, to be honest, this post was originally going to be a short aside, about myself being delighted with the delay function on my washing machine.

For content, I bought a house with my girlfriend a little over 18 months ago, and the seller left a perfectly functioning washing machine. It was always something we were thinking about replacing at some point in the future, especially when after a few months we noticed that it would occasionally leak water from the door. Probably just needed a new seal, but it was old anyway, and it didn’t fit the style in our kitchen anymore.

Luckily for us, a few weeks ago someone in my girlfriends family had a washing machine going spare (moving house), and it was in pretty good condition. So we gladly took it off their hands.

Fortunately for me, it had a delay function. I know it’s not advanced technology, I’ve seen what you can get for stupid amounts of money. But it’s enough to do the job for me.

The only issue I have with doing the laundry is that I always feel the need to do it at weird times. For example, it’s 22:00 and I’ve only just put a load of washing on. That’s not a problem in itself though, the issue is that I would prefer to have it freshly washed at a time where the sun is out and I am free to put it outside to dry. Right now, that time is around 12:30pm. Because that’s around the time I take my lunch break, and it means I can get it put in a few minutes, and it dries pretty quickly.

So by having a delay function, I’m able to be sporadically productive at weird times, put a load of washing in the machine, and set it to be ready for exactly when I need it. Except, the delay is exactly that, a period of time before the function starts, not a set time for it to run or finish by. Also, the precision is to an hour. So the only calculation I need to do is to work out the number of hours until noon the next day, and then subtract however long the wash duration is. Not exactly a hard calculation, but I’m lazy. So I came up with a needlessly complicated shortcut to do it for me.

If you’re expecting something minimal that just does the job, then look away now. This may look a mess, but it produces a pretty nice output.

You can check out a full size image of the shortcut, or download it straight away if you want to check it out. I’ll do my best to explain what’s going on, but it may bet easier to have a look yourself.

First of all, it asks for the time that I wish the washing to be ready. In most cases this will be 12:00, so that’s the default value. It then formats this time, so it can be used later in the format, and stores it in the Washing Time variable.

Afterwards, it calculates the time between the current date and time and the selected time (which by default uses the current date). It’s to check whether that time has already passed in the current day or not. If it has passed, then I must mean tomorrow, if not, then it’s today. I could simply prompt for input, but if I can save any interaction then I will.

If it determines that I must mean tomorrow, then it adds 1 day to the date stored in the Washing Time variable, and also sets a new variable called Today or Tomorrow to “tomorrow”.

If it’s for today, then the date stays the same, and Today or Tomorrow is set to “today”. This variable is nothing special, just a string that I use later on in the final message that appears. This if statement was just a good place to put it, to avoid duplicate logic.

Now it knows the date and time that the wash needs to be ready by, it also needs to take into consideration the duration of the wash. Similarly to the previous input, the most used wash on my washing machine is 76 minutes, so I put that as the default to make it easier.

That duration is subtracted from the earlier calculated wash time, this will be the time that the wash needs to start. It then calculates how minutes there are until that time.

That duration is now formatted into an Hour:Minute format. The minutes are first calculates using the modulus operation, and the hours are calculated by removing the aforementioned “minutes” value, and diving by 60.

There is a little if statement afterwards to check if the minutes value is less than 10. This is to make sure the minutes are always formatted as two digits. There could be a better way for this, but I know that this way works.

After calculating the delay needed, it wraps it into a friendly message with all the information I may or may not need.

Example: 🕰 The required delay for a 76 minute wash to finish today at 12:00 is 10:32 🧼


Now I’ve finished writing about this, it has occurred to me that I’ve blown this problem completely out of proportion. But it was fun, so who cares?

Washing Delay Calculator:

App

Charty for Shortcuts

22nd May 2020

I came across Charty recently on Twitter, and it looks like it’s going to be a great addition to the growing collection of apps that are designed to slot directly into the Shortcuts app.

After playing around with it, I was going to write an in-depth article on what I thought about it, but instead I’ve found three articles that I think explain it really well. And they also include examples so you can see what type of charts you can create.

Greg Morris:

This is one of those apps that at first you dismiss, but when actually looking around the app you realise just how helpful it can be. That’s because developer Rodrigo Araújo has thought about almost every aspect of the app. Building on the success of his first app ChartStat he aims to make it easy for everyone to visualise any kind of data.

Jason Snell:

Making charts by hand is labor intensive. But it gets easier if you can make the chart one time and just update the data as new numbers flow in. If that sounds like a job for user automation, you’re singing my tune—and I’m happy to report that the new app Charty is built to add charting capabilities to the iOS Shortcuts app.

Matt VanOrmer:

There are lots of Shortcuts actions and routines that generate data and could easily benefit from a simple bar graph or pie chart to provide useful insights more quickly and effectively. One example that comes to mind is graphing time-tracking data from Toggl once every week, let’s say, to see what tasks or projects you’ve been the most busy with — all without having to open the unpleasant Toggl app or the clunky web client from your iOS device. Charty is the perfect companion for those who accumulate lots of meta-data about their lives and want to frequently revisit and reassess the areas they are seeking to improve — whether that be calories burned, books read, or tasks completed, Charty plugs right into your existing Shortcuts routines and allows you to quickly turn those datasets into easily-digestible graphics. The option to create default chart format settings and custom “Export Profiles” of chart size, font size, and background color both help to add consistency in how your charts are formatted before saving them for yourself or sharing with the world.

Automation

How I’m Using Shortcuts and Data Jar To Help Write Link Posts

18th April 2020

Last night I spent some time reading on my iPad, and I noticed a few articles that I might want to link to from my blog. Except I didn’t want to start creating drafts in iA Writer, or doing any manual work. I just wanted a way to remind myself that I want to link to this at some point.

I started to think that I could simply create a reminder in the Reminders app (I’ve switched from Things), possibly with the URL as a note so I could get back to it when I needed it again. However, that would require me to then later load the URL, and fetch the details from it. And seeing as I would have had the article loaded at the time of reading, it made more sense to store this data, and then be able to reference it at a later date.

So I came up with an idea of two shortcuts, one to store relevant data about the article I wanted to reference, and then another which I could use to select from the list and kick off a draft in iA Writer.

That’s when I thought about using the recently released data store app, Data Jar, which is a fantastic tool for storing all kinds of data.

Store Link Post Idea

To start off, the Shortcut I created to do the initial data storing and reminder creation was relatively simple. It accepts input from the Share sheet, in the form of a Safari web page, and then has just three actions:

  1. Add a new reminder with the title of the article to my blog list.
  2. Create a dictionary with four pieces of data – the title, URL, any text that was selected that I want to quote, and also the author. Although I’ve found the author to not be very reliable.
  3. Store this dictionary at the end of my drafts list in Data Jar.

Download the Shortcut: Add to Drafts List

Starting a Link Post

This shortcut is a bit more complex, as it has to do quite a few things:

  • Retrieve the list of link post ideas from Data Jar.
  • Show the list, and allow the user (me) to select an option.
  • Transform the various pieces of data into a link post outline.
  • Create a new document in iA Writer.

It’s a bit long, so I’ll put the long screenshot below, and then explain why it may seem pretty complicated for what it does, and the things I had to work around.

Start Link Post From Draft Shortcut

To start off, the shortcut gets the list of drafts from Data Jar. This contains all the drafts that have been saved.

It then does a little transformation with that data, using a temporary variable in Data Jar. It clears the value for the specific key I’m going to use, and then it loops through the list of articles, and extracts the title and the index of each article into a new list. This is because we need to show the list of articles, and also perform operations on the specific article that was selected.

The temporary list is then displayed, and from the chosen article, the Index is then used to fetch the complete article data from Data Jar. That includes the title, author, page selection (snippet), and the URL.

Once that data is extracted, the page section is formatted as a Markdown Blockquote via Text Case (my app), and then it’s put together with the rest of the data to form a basic link post outline.

Finally, the outline is URL encoded and opened as a new document in iA Writer via the URL scheme.

Download the Shortcut: Start Link Post From Draft


These two shortcuts are simple in theory, and to be honest I could have achieved the same result with less complexity, and maybe even without Data Jar. However, I like that the storing and kicking off a link post in iA Writer are separate processes. Because it allowed for more flexibility in the future and also doesn’t distract me at the time of reading an article. Which was one of the big reasons for me making these.

I really liked using Data Jar for these as well, so I hope I can make use of it again in future shortcuts!

Links

Find the apps used, and the shortcuts below:

Automation

How I Automate Publishing Blog Posts

30th May 2019

I wrote recently about how I’m automating my daily journal, and it mainly focussed around how I started the writing, as the publishing was quite a manual process.

However, I’ve now managed to automate the publishing part of my writing process. Which I’ve been using for every blog post since, not just my daily journal.

I started off with Federico Viticci’s Publish to WordPress shortcut1, which he posted on his incredible Behind the Tablet article. But I had to make a few changes to make it work with the way I’ve configured my blog.

Here’s Federico’s description of his shortcut:

Publish a Markdown post to WordPress via the Shortcuts action extension. The shortcut can extract the h1 Markdown header from a post and use it as title. Optionally, you can publish both standard and “linked list” post types by adding a custom field supported by your WordPress installation.

The changes I made were:

  • Changing the Format parameter of the ‘Post to WordPress’ action to Ask When Run. This way I can alter between standard and link type posts. The shortcut already handled linked posts so it could extract a URL and add that as a custom field on a post. But my theme styles linked posts slightly differently, and it depends on the post format to do that.
  • I also changed the Publish Date parameter to Ask When Run as sometimes I like to schedule posts. Or if I’m publishing my journal, and I’ve slightly run into the next day, I like to make sure it’s published on the correct date.
  • One section I removed was the file saving, as I don’t particularly need another copy of the final results. I like to think of my blog as the place for canonical copies.
  • The last action was to open MacStories in the browser, so of course, I changed that to the url of this blog. So I can quickly check out the live version.

In essence, it’s a relatively simple shortcut, in that it takes text and publishes it here on my blog. However it takes care of so much of the annoying parts of the publishing process, such as setting the categories, tags, post types, extracting links for sources, and still more. I guess that’s the perfect case for automation.

One last thing I have to call out, is the natural language parsing when entering a publish date for a post. When using the web interface for WordPress, I found it really irritating to use the date/time picker. But now I can write something like “tomorrow at noon” or “yesterday at 23:00”, and it just understands it perfectly.

I’m not sure if this will directly benefit anyone, but I hope it at least shows some benefits of using automation when publishing to a blog. And also, that it’s very beneficial to keep checking out the many Shortcuts that people like Federico are sharing.

Download Federico’s “Publish to WordPress” shortcut.

Download my modified “Publish to WordPress” shortcut.


  1. The shortcut also includes the Title Case action from my app, Text Case. Which I (with a massive bias) find very helpful. 
Automation

How I Automate My Daily Journal

17th May 2019

Since the start of this year, I’ve been writing a daily journal on a separate part of this blog.

After I started writing the entries, I realised I didn’t want the boring task of creating the file in a specific directory, and creating the same title/header over and over again. So I added a tiny bit of automation.

Things Task

iVBORw0KGgoAAAANSUhEUgAABS0AAAo4CAYAAAC8JoK+AAABgmlDQ1BzUkdCIElFQzYxOTY2LTIu-2.PNG

The first thing I did was to set up a task in Things, that repeated every day, simply to tell me to write my journal. After a while, I noticed that I would sometimes get very close to 12 before remembering about it. So I added a reminder for 11 pm, which gives me a bit of time to delay and still get it done in time.

Journal Template Shortcut

To take the hassle out of creating the initial file, I created a relatively small shortcut that creates the template and opens it in iA Writer.

I have a specific directory for my journal entries, and this keeps them all in one place.

It also uses the current date to create the filename and the heading for the post.

From there, it opens iA Writer, so I can jot down what I did in that day. And it’s ready to be published

You can download my “Journal Template” shortcut for reference.

Linking the Shortcut to the Things Task

Image.PNG

While Things is useful enough to help me remember I need to write my entry, and the shortcut helps to create the initial file, I also linked these together.

I did that by adding a custom URL into the body of the Things task, so whenever it notified me, I could tap on the task and then on the link. It would then launch the shortcut, and lets me immediately start writing.

It also allows me to not starting right away, as sometimes I’m not in the best place to do it, or I just want to put it off a bit longer.

The url is quite simple, and is in the following format:

shortcuts://run-shortcut?name={name}

{name} is the name of the Shortcut, but URL encoded. You may be able to work this out yourself, but my app Text Case can also do this for you.

More Automation

After I finish writing my journal entry for the day, I then publish it to my blog. I use the built-in “New Draft on WordPress” share extension, which then opens the draft in Safari where I can add the category, and publish.

It’s a reasonably quick task, but something else I plan on automating. So in the near future, I will be creating another shortcut, that can take the latest journal entry and publish it to my blog using the specific category and time I like.

Automation

Automate your financial life with Monzo and IFTTT →

7th June 2018

We believe that a truly smart bank should empower people to manage their money in a way that suits them. Today, we’re proud to announce that we’re the first bank to partner with the world’s largest automation platform — IFTTT!

In a nutshell, IFTTT lets you personalise how you manage your money. You can create your own rules, called Applets, to connect your Monzo account to the services you regularly use. For example, say you use the iOS Health app to log your calories. With IFTTT, you could enable our pre-made Applet that means every time you buy anything at Starbucks, you’ll automatically log 200 calories on iOS Health.

Yet nother reason why Monzo is the best bank in the world.

Read about Monzo’s IFTTT Integration.

Automation

How to Create File Templates on Your Mac With Finder's Stationery Pad Feature →

30th May 2018

Tim Hardwick, writing for Mac Rumors:

Stationery Pad is a handy way to nix a step in your workflow if you regularly use document templates on your Mac. The long-standing Finder feature essentially tells a file’s parent application to open a copy of it by default, ensuring that the original file remains unedited.

Stationery Pad doesn’t get much attention these days, but it’s a neat alternative to repeatedly editing templates and using the “Save As…” command, which can lead to overwriting the original file if you’re not too careful.

I had no idea this existed. I will most certainly be making use of it in the future.

Apple

Hey Siri, Do This Then →

1st March 2018

Matt Birchler has a pretty common request for Siri, and that is the ability to schedule requests.

While all of these assistants can turn things on, turn them off, move thing up and down, and such, they can only do those things now. I can turn on the lights now. I can open the garage door now.

It makes so much sense for this to be supported. Sure you might be able to schedule actions inside of an app. But if voice is an official method of input, you should be able to do everything with it.

There’s not even a particularly high barrier in creating a delay/schedule system. The simplest method I can think of, is that when a voice assistant hears a request with a related time, all it needs to do is store that exact request (even plain text is fine), along with the date/time. Then the system can set its own reminder, and at that time, it simply performs the request automatically, and deletes it from the queue.

Page 1 of 2 pages Older posts →