Someone help me understand "Get Type of [Shortcut Input]"?
Can someone explain to me how the "Get Type" action works with Shortcut inputs? I swear I saw a post ages ago on Reddit that answered this question, but now I can't find it. Essentially, I'm trying to build a shortcut for the Reminders app that takes a certain action depending on the input type (so URLs do one thing, images do a different thing, locations do a third thing, etc.).
The only problem is that I can't seem to figure out how Apple determines the input type on any given item. Sometimes, I'll have two inputs which certainly *seem (*at least to me) like the same type, only to discover they're two different types when I run them through the "Get Type" action.
Here's an example (please note: for all of these tests, I sent the input from the stock Photos app using the Share Sheet [as opposed to Get Clipboard, Ask For Input, etc.]):
- On my MacBook (an M1 Air running public beta) when I share a Live Photo, the "Get Type" action lists it as Image.
- On my iPhone (13 Pro running public beta), when I share that same Live Photo, the the "Get Type" action lists it as Photo media.
- On my MacBook, when I share a marked up photo (so, Live Photo is turned off) from the stock Photos app using the Share Sheet, the "Get Type" action lists it as URL.
- On my iPhone, when I share that same marked up photo from the stock Photos app using the Share Sheet, the the "Get Type" action lists it yet again as Photo media.
- I didn't even bother checking what would happen if I if I tried to share the same photo from Lightroom or Google Photos, since the above is already insane enough as it is.
Other times, the annoying scenario above gets inverted: two seemingly different inputs that I send via the Share Sheet will end up having the same type. Usually, this is because one of these inputs includes a few different items. For instance:
- On both my MacBook and iPhone, if I share a location (like a local restaurant or something) from the stock Maps app, "Get Type" lists it as a URL (but not a location).
- On both my MacBook and iPhone, if I share a PDF from Finder or the stock Files app, "Get Type" receives a PDF (thank God, at least those process correctly).
- On just my iPhone, if I share a tab from Safari, "Get Type" shows it to be a Safari webpage.
- HOWEVER, if I share a tab from Safari on my MacBook, "Get Type" receives THREE items: Safari webpage, PDF, and URL!!
For that first set of examples (with the photos), the only solution I can think of is to use "If Or" statements (I have Toolbox Pro installed) to classify the different categories ("Photo media," "Image," "URL" etc.) under one umbrella, and then using the "Get Images from Input" action to pull the image again. But again, it seems annoying to have to know exactly what every possible input could be received as in Shortcuts.
However, this solution becomes kinda convoluted when I start to think through my second set of examples. For instance, if I want to send a location in Maps to the Shortcut (which it receives as a URL), I could just use the simple "Location" action and set the variable to Shortcut Input (aka that URL). However, what if I just want to send a webpage or a photo to the same shortcut? Do I just have to use a lot of "If" statements to filter the URL to various categories? Surely there's a simpler solution, no?
As if this wasn't enough, in that Get Type action (or any other action that receives a variable, as a matter of fact), I can go ahead and select "Shortcut Input" as variable. However, when I do that and then tap the variable again, there's a dropdown menu that asks me to specify the type of my Shortcut Input! WHAT?
My head is spinning. Hopefully this makes sense. Sorry if this is a noob question; feel free to ELI5. Just hoping someone can help me figure this out...
Posted Mar 12, 2024, 6:30 PM UTC