Going Wayback with Keyboard Maestro and Safari

Do you ever find yourself needing to visit web pages that are no longer available? I seem to go through phases of this, and being able to reference back to an archived copy is very useful. There are a number of services and approaches where you can archive your own copies of web pages, but that does not help when it is a site you never visited before and so did not have a chance to archive a copy for your own use.

Enter the Internet Archive’s “Wayback Machine”, and I have a little Keyboard Maestro macro to make it a little easier to use of it.

Recently I had need to visit the Internet Archive to use the Wayback Machine. You go to the site, plug in the web site address to a search page, hit return to start the search then sit back to see if you get any useful snapshots returned. Every time I used it I figured I should add a workflow to Alfred or something to speed it up. This time around I did, and after a bit of consideration I opted to use another of my favourite Mac automation tools, Keyboard Maestro.

With Keyboard Maestro I was able to create a simple single step macro to search for the current URL in the Wayback Machine. The Wayback Machine you see uses a straightforward URL structure to search for a URL:

https://web.archive.org/web/{time index}*/{url}

The {time index} is a string of 14 digits combining the year, month, day, hours, minutes, and seconds of a point in time. This is where the search will return up to. Usually when I search, I would like to search for anything before today (you never know, maybe the page got taken down yesterday, but was also had a snapshot taken yesterday), so only the first eight digits need to be populated.

This can be achieved in Keyboard Maestro by using the ICUDateTime token.


The URL of the current web page can also be accessed via a token. The %SafariURL% token is the one I am using as I tend to use Safari on my Mac unless a site or service requires otherwise - the better battery performance of using Safari is useful for me.

A full search URL can therefore be constructed as follows.


This can then be used in an Open URL action to trigger the search.

I have this set up in my macro group for Safari that is only active when Safari is active, but I also have it mapped to a button on my Elgato Stream Deck (with a nice Wayback Machine logo on the button) that is likewise only active when I’m using Safari.

When triggered, a new Safari tab opens with the results of a Wayback Machine search for the current page. This saves me having to copy the URL, open the search page, paste the URL, and trigger the search. So much more efficient for very little effort, and I really don’t know why I didn’t spare five minutes to set the macro and Stream Deck button up sooner.

It only takes a minute to set up your own copy of this macro in Keyboard Maestro, but if you want to just download a copy instead, you can do so here.

Hopefully, this little automation will reduce the friction enough to save you a bit of time here and there and just help your day go that little bit smoother.

Author: Stephen Millard
Tags: | keyboard maestro |

Buy me a coffeeBuy me a coffee

Related posts that you may also like to read