Sometimes Shortcuts makes me scratch my head in bewilderment at how convoluted dealing with different data types can be. If you ever pull in an RSS feed to parse, you’ll know what I mean.
I’m writing a shortcut for Ronnie Lutes to easily publish episodes of The Liner Project. Why he needs a shortcut to do this is another topic, but primarily it’s because we’re hosting his site in a static site generated by Hugo. In order for him to get an episode added, uploaded, and scheduled for publication without having to deal with an annoying checklist of tasks that all have to be done in exactly the right way each time, an automation is perfect.
In order to present as few information-gathering dialogs and text boxes to Ronnie as possible, the shortcut tries to figure out everything it needs to about the episode being published, including things like season and episode number. A lot of this can be gathered from the mp3 file itself, and most of the rest from the show notes file that the shortcut grabs automatically from Drafts.
In fact, I could just parse the episode number and podcast season from the draft show notes, but I decided I want to know these in advance so I can make sure when I search Drafts for the note I want, I can check against the episode number to ensure that I’m grabbing the right one. This is possible because the universe presents me with an absolute source of truth with respect to the most recent episode number: the podcast RSS feed.
All of this to say, I want to peek into The Liner Project’s RSS feed and see what the episode and season numbers I need are.
This seems easy, and in fact I have quite the collection of text-parsing bricks spread across many shortcuts in my employ. But this is the first time I’ve hoovered in an RSS feed and immediately set about parsing it, and I couldn’t make it work… no matter what Type I tried setting the contents of the feed to, I was getting an object back instead of text.
The Type settings themselves are kind of obscure, and everyone who uses Shortcuts has to learn that they exist and that knowing they exist can be the difference between giving up in frustration and getting your shortcut to work. But in this case, there’s an even weirder answer: the Set Name action.
Set Name allows you to change the name of a file or piece of data you want saved as a file. In my case, setting the name of the RSS feed to something.txt immediately makes it possible to grab the contents as plaintext and work with them as intended.
Is it weird? Yes. Do I wish Shortcuts would understand that if I put the contents of an RSS feed into a text block that I want it treated as text? Yes. But it does what I want, and sometimes that’s all that matters. Shortcuts isn’t about producing works of art, it’s about getting work done.