I have a macro that opens a certain Finder folder, and I'd like that macro to also then select – not open, just select – the first file in said folder that includes the string "***" in its file name. (Note that the files are sorted alphabetically.)
Is there any relatively straightforward way to do this? Thanks!
Thank you, @noisneil! I will be sure to try this out when I'm home tonight.
One other related question for you: What if you alternatively wanted to select the child folder (but not file) of your current folder that is last alphabetically?
For example, if you were in a folder that has the child folders "2021," "2022," and "2023," and also the files "2024 Plan.xlsx" and "2025 Proposal.docx," the macro would know to select the "2023" folder.
To adjust the previous macro, you'd check the file type, like so:
Select Subfolder Containing String in Parent Directory.kmmacros (22 KB)
Of course, if the folder name is literally 2023, it's as simple as:
Select Subfolder by Name in Parent Directory.kmmacros (20 KB)
Thanks, @noisneil! This works perfectly.
You mean first not last.
Why the summary? Have I missed something?