I have a lot of Shortcuts. Like hundreds. And most of them are old, outdated, broken, or designed around apps I no longer use. I needed a way to structure a cleanup of my Library, but I wasn’t sure how to do it. By folder? Maybe. But some folders have five Shortcuts and some have a hundred. So, I decided to make a Shortcut to plan my Shortcuts cleanup.
To consider a Shortcut reviewed, I had 4 simple criteria…
- Does it work? Are there deprecated actions, blocks from uninstalled apps, etc. If it’s broken, is it worth updating? If so, update it. If not, delete it.
- Is it still useful? I’ve been using Shortcuts since it was Workflow, so I have some pretty old stuff in here. Do I still need this?
- Is it in the right place? My goal is to have zero Shortcuts in the root. Everything should live in a folder.
- Is it properly named? I’ve gone through lots of naming conventions over the years. Time to modernize and consolidate.
If the Shortcut makes the cut, great. If not, it gets deleted. Before I started this process, I made a backup of my Shortcuts just in case.
The Shortcut
1 |
Find Omnifocus Projects |
Step 1: Find Omnifocus Projects where the title matches the title of my Shortcuts Cleanup project. Create this project before running the Shortcut. |
2 |
Ask for Input |
Step 2: Ask for Number determines how big you want your batches to be. I chose 15 at a time. |
3 |
Ask for Input |
Step 3: Ask for Date determines when you want to start editing your first batch. I picked the next Saturday. |
4 |
Adjust Date |
Step 4: Adjust Date to subtract a week. I do this to make the Repeat loop easier. |
5 |
Set Variable |
Step 5: Set Variable to dueDateZero . Not necessary, but easier to find defined variables than it is to find Smart Variables in longer Shortcuts. |
6 |
Adjust Date |
Step 6: Adjust Date to subtract a day from dueDateZero . This will become the defer date. |
7 |
Set Variable |
Step 7: Set Variable for deferDateZero . |
8 |
Get Shortcuts |
Step 8: Get Shortcuts to get all shortcuts. |
9 |
Count Items |
Step 9: Count your Shortcuts (I had a lot) |
10 |
Calculate |
Step 10: Calculate the number of Shortcuts divided by the size of the batch you chose in step 2. |
11 |
Round Number |
Step 11: Round the result. Make sure to round down so you don’t end up with a remainder. |
12 |
Set Variable |
Step 12: Set Variable to the rounded number. This will be used as the repeat loop count. |
13 |
Text |
Step 13: Text with the Shourcuts pulled in step 8. This turns your Shortcuts into a simple text list by title. Set the My Shortcuts token to type=text. |
14 |
Split Text |
Step 14: Split Text by new lines. This will create one “thing” per line. |
15 |
Repeat |
Step 15: Repeat opens the repeat loop, and the variable tells it how many times to loop. |
16 |
Adjust Date |
Step 16: Adjust Date adds the repeat index (the number of times the loop has run) number of weeks to the dueDateZero variable. |
17 |
Adjust Date |
Step 17: Adjust Date again to iterate over the Defer Date |
18 |
Calculate |
Step 18: Calculate the repeat inex times the batch size. This becomes the start number for step 20. First loop will be 15, second is 30, etc. (if you chose 15 as the batchSize in step 2) |
19 |
Calculate |
Step 19: Calculate the startSize plus the batchSize . This gives you the end number for step 20. |
20 |
Get Items |
Step 20: Get Items in Range of the start number (step 18) and the end (step 19) of the “things” in the Split Text (step 14). Loop 1 gets 1-15, loop 2 gets 16-30, etc. |
21 |
Repeat With Each |
Step 21: Repeat With Each of the items from step 20. |
22 |
Text |
Step 22: Text containing the repeat item (the Shortcuts title) and some TaskPaper syntax. |
23 |
End Repeat |
Step 23: End Repeat will store every line created in step 22 as another list of text. |
24 |
Text |
Step 24: Text containing more Taskpaper formatted text. Adding the Repeat Index lets me see text like “Shortcuts Cleanup Batch 1”, “Shortcuts Cleanup Batch 2” etc. along with due and defer dates, then the repeat results from step 23. This will format the entry as a task with a due date (the first bit) with a bunch of subtasks (the repeat results bit) |
25 |
Add Omnifocus Taskpaper |
Step 25: Add Taskpaper will take the text in step 24 and add it to the project you found in step 1. |
Running this Shortcut will give you a bunch of tasks in Omnifocus named “Shortcuts Cleanup Batch {some mumber}” with 15 subtasks, each with a title of a Shortcut. It will set a defer and due date on each main task, and the @autodone(true)
flag in the Taskpaper will set the main task to be completed when all the subtasks are done. Now, I just go through this list every weekend and knock out 15 Shortcuts. I’m 2 weeks in so far, and it’s going well. I’ve gotten rid of about 15 Shortcuts already. According to my Omnifocus project, I have 442 to go, and will be done in early September. 🙃
Screenshot of the Shortcuts Cleanup Omnifocus Project
You can get the Shortcut here
Comment or reply on Mastodon
🗓️ March 1, 2023
🏷️ Omnifocus
🏷️ Shortcuts
🏷️ Automation