Shortcut that searches for filenames and/or extensions?

As part of a larger collection of shortcuts all intertwined with each other I need a way to search folders on either iCloud/Dropbox/network drives for a specific type of file, and if present perform some sort of action.

So far I’ve been content with specifying each folder and filename, one at a time, but are looking to expand to specifying top folder and then search all sub-folders automatically.

In this case I want my subtitle downloading shortcut to check my Media folders sub-folders for .srt files - if found = ignore, if not found create dictionary with name of movie for use later, when subtitle needs to be downloaded.

I know I can specify a folder in the GET FILE action, but that makes the shortcut download all files inside the folder which is unintended since I have my movies (copies of my DVD/Blu-ray collection - NO pirated movies, red.) on an Apple Time Capsule logged in wirelessly to my Wi-Fi & shared to my TV in Infuse - maintained through FileBrowser on iPad Pro.

I only need it to look at the filenames and extensions - not download the files.

Is this possible in Shortcuts, or should I learn JS and go through Scriptable, perhaps (if so, any help higly appreciated :joy:)?

I can’t think of any method in Shortcuts to only get the file names. Therefore Scriptable would be a good approach, as it also supports file and folder bookmarks of files outside of the Scriptable folder, but I don’t know, if all files inside the bookmarked folder are included recursively. @simonbs what’s the case here?

One approach might be to shift the processing off of a mobile device to something else with the appropriate access. If you had an always on Mac with access, or even something as cheap and ubiquitous as a Raspberry Pi Zero (costs less than 5 GBP - that’s iOS app pricing right there, just add micro USB power and a microSD card for storage), you could trigger a script or command to run on the device via SSH in Shortcuts, and that could send back the data to process, or even do the processing in a script on that device and just send you back the actioned/filtered results.

The uses for this sort of set-up only increase from there :wink:

1 Like

Well this post just cost me a few $$s. Looking forward to my package arriving and beginning to explore this world… :smiley: — jay

1 Like

Yeah had a feeling that this would be more viable than Shortcuts
Might need to learn JS, soon🤔

@sylumer yeah I’ve been contemporary laying getting a Mac, again (I went all iOS six months ago, and this is the first time I’m actually stuck😅) - I might get a used Mac Mini - preferably one with build-in Super rive so I can add my CD collection to  Music as well, though I had hoped to stay off conventional computer hardware.

I just really really really would like to live the iOS-only-lifestyle that Apple!- bit by bit - is encouraging us to😁