After working on it for a bit I decided this was how I’m going to manage backups. A copy each time I edit them.
Time Machine backups of Shortcuts
This allows you to have a multiple level of ‘undo’, similar to Time Machine on macOS, hence the name (sorry if I tricked you into reading this). You are forced into using either Edit Shortcut, or Shortcut Projects, they will make a backup before going into the Shortcut to edit it, if you’re not bothered about backing up everything just the major ones you’re working on, use the Shortcut Projects. To recover a backup first you select the Shortcut you want to recover, and are then given a time since list of backups you can recover from.
- Make a ‘Backups’ folder in your Shortcuts folder on iCloud
- Run Backup All in the Time Machine Shortcut
- Move Shortcut Projects and Edit Shortcut to the top of your list of Workflows, so you can quickly Edit Shortcuts, skip to Projects.
Shortcut Projects - Quickly back up and skip to editing Shortcuts you’re working on
- Add/Remove Projects your currently working on to have a quick list of projects to skip to
- Backs up shortcut before opening it in editing mode
Edit Shortcut - Backup Shortcut before editing
- Select or search, back-up, and opens the Shortcut in editing mode
Time Machine - Manage & recover backups -
- Clean up old backups, can filter by when created, or name
- Browse Backups
- Backups by time since created eg 12 hours since
- Preview code before deciding if to recover.
- Backup All
Other Workflows (required)
Choose Workflow :
- I use this in several other Workflows, it’s just a workflow for choosing Workflows, with the added feature of search. You can use it in your own Workflows if you have a need for it.
- You might notice that it shows the type of any input/clipboard I use this in other workflows, not so needed here
CopyPaste Action Parser :
- It converts the data format that Workflows are stored in into a readable list of commands, and is used when browsing backups to recover to help you understand whats changed in the backups you are looking through.
Shortcuts take up only a small amount of space, just a few k usually, keeping a number of copies of a Shortcuts doesn’t take up a lot of space. Yes, if you backup all of your 300 Shortcuts it may be a few Mb, but after that you would usually be adding to it a few at a time.
This is a v1 so for example Shortcut Projects isn’t very smart you can accidentally add the same Shortcut twice, there needs to be a better way of deleting old backups eg keep at least x no of backups would be good, and could do with having the icons added to the menu.
There’s no particular way to deal with backups where the original isn’t present, or has changed name, in the meantime its quite easy to recover these from the Shortcuts/Backups/ folder.