Hey @forums2012,
In general I like to use the Unix find
command for this sort of thing. It was designed to do exactly this sort of job.
I've broken up the parts of the command using the Bash continuation character “\” to place them one per line for easy viewing and identification.
find == Unix command.
~/test... == Target dir.
-type f == Restricts to finding ‘files’.
-depth 1 == Prevents descent into any sub-directories.
-iname == Case-insensitive name (can use wildcards).
** The main pitfall of Unix commands for this sort of thing on macOS is that they can descend into package files that are really directories like .app “files”. If you need to avoid packages then we have a very good AppleScriptObjC solution.
The way I've written the find
command will return the full-path to each found file, although it can be restricted to returning only file names.
-Chris
Find Files in a Directory with Wildcards in the File-Name.kmmacros (4.6 KB)