Recursively Search Four Folders For Specified String – Trash Found Items

Hi!

I know it's a fairly old request, I'm actually looking for something really similar, so did you finally figure it out?

The only differences are that I'd like to perform search simultaneously in many specific folders, and display results in a standard Finder window.

Anybody help?


Moderator edit: 2021/12/24 11:02 CST -ccstone

To be clearer, the full workflow I have in mind is:

Prompt for 2 text inputs -> search recursively for files & folders names matching these 2 inputs in 4 specific folders -> display results with name and full path with the ability to perform a multiple select among them -> moving selected items to trash

Hey @Milk,

You can't.

You can search multiple locations, but you can't display the results in a Finder window.

To do something like that you need a more specialized tool:

-Chris

@ccstone, thanks for replying

Houdahspot is precisely the app I try to "mimic" through this KM macro ! :sweat_smile:
Would it be possible with some kind of KM-generated window ?

To be clearer, the full workflow I have in mind is:

Prompt for 2 text inputs -> search recursively for files & folders names matching these 2 inputs in 4 specific folders -> display results with name and full path with the ability to perform a multiple select among them -> moving selected items to trash

Does it sound possible? I'd like to go on the path of learning to do such things with KM.

Yes, although perhaps not as neatly as you would wish.

This should get you started:

MACRO: Choose File From Folder List With Incremental-Search and AutoComplete

At present:

  • It only supports files – not folders.
  • It does NOT function recursively.
  • I does NOT support multiple folders.
  • It opens the selected files.
  • The folder-lister is AppleScript but can be changed to km-native actions.

All of these issues can be overcome.

-Chris

1 Like

First of all, happy new year to everyone here !
@ccstone thanks for the lead, it definitively seems to be a good starting point
I think I understand the global logic of the provided script, but I'm having a hard time with the

SCRIPT: Build KM Prompt List of File Names and Paths (AS)

part.

It's Python, right ? I need to take a deeper understanding at this language :bulb: