Jump to content

Find All {query}-named files


Recommended Posts

Hello! I love Alfred. The find and buffer work awesome for handfuls of files, but I'm a product manager for a collection of websites that may soon number in the hundreds, or thousands! Using the buffer to add each file may become untenable. 

 

Is there a way (native Alfred "find", or otherwise) to automatically open all of the files with an explicit file name at once? Maybe even just limiting it to within a parent folder. My dream workflow would be something like the keyword + query combo of "findall config.yml" opening all of the config.yml files in Sublime (the default editor of yml) at once. 

 

I googled a bit but think I could use an expert-shove in a direction!

Link to comment

Hello! I love Alfred. The find and buffer work awesome for handfuls of files, but I'm a product manager for a collection of websites that may soon number in the hundreds, or thousands! Using the buffer to add each file may become untenable. 

 

Is there a way (native Alfred "find", or otherwise) to automatically open all of the files with an explicit file name at once? Maybe even just limiting it to within a parent folder. My dream workflow would be something like the keyword + query combo of "findall config.yml" opening all of the config.yml files in Sublime (the default editor of yml) at once. 

 

I googled a bit but think I could use an expert-shove in a direction!

 

Are you familiar with creating workflows within Alfred? More specifically, have you taken a look at File Filters? You could create File Filters that are fine tuned to find the files you want with a keyword. Check those out and see if they may fill your needs. If you need help, let me know and I'll try to help you where necessary

Link to comment

Yeah, File Filters look awesome, but unless I'm missing something I can only bring up a file list that still needs buffering or something to open multiples, I want something a bit more hands-off. I played around more trying to leverage my n00b terminal skills more than Alfred features. The closest I've come so far is a workflow and some grunt work: 

  1. A keyword input with the argument of the file name. eg. "findfiles config.rb"
  2. This fires off a terminal command: find . -name '{query}'
  3. The result in terminal is line after line of the files with that explicit file name (I think this could be time consuming eventually).
  4. I can then copy / paste this into Sublime. I can then do some "Subl parcour" to add "subl " at the start of each line and " && " at the end of all but the last line. 
  5. When I paste this new result into the terminal it will open all the files in Sublime (the subl command is a common alias on my system). 

Not sure if this can or should be improved - if there ever are thousands of results maybe it's better to get a list in terminal than bog the system down opening files! 

Link to comment

Yeah, File Filters look awesome, but unless I'm missing something I can only bring up a file list that still needs buffering or something to open multiples, I want something a bit more hands-off. I played around more trying to leverage my n00b terminal skills more than Alfred features. The closest I've come so far is a workflow and some grunt work: 

  1. A keyword input with the argument of the file name. eg. "findfiles config.rb"
  2. This fires off a terminal command: find . -name '{query}'
  3. The result in terminal is line after line of the files with that explicit file name (I think this could be time consuming eventually).
  4. I can then copy / paste this into Sublime. I can then do some "Subl parcour" to add "subl " at the start of each line and " && " at the end of all but the last line. 
  5. When I paste this new result into the terminal it will open all the files in Sublime (the subl command is a common alias on my system). 

Not sure if this can or should be improved - if there ever are thousands of results maybe it's better to get a list in terminal than bog the system down opening files! 

 

How many files do you usually expect to have in results when doing a specific search? A handful, dozens or more?

 

Using the File Filter workflow David suggests, you can go to Alfred's Advanced prefs and choose one of the action modifiers to be set to "Action all visible results", so that results from your File Filter can be actioned with one hotkey press. The reason I ask how many results you expect to have is that this feature is, by choice, limited to the results you can see; Therefore 9 results maximum. This is to avoid bogging down your Mac by mistakenly launching thousands of files at once.

 

If you need to open more files than that, then keep working on a workflow with David for something a bit more customised to your needs :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...