Jump to content

Search files by extension


Recommended Posts

Inspired by this post I have dabbled.

 

Introduction
This workflow enables you to search for files with a given extension in a given folder (and, optionally, its subfolders) and returns them in Alfred. You can choose whether or not to include subfolders in the search.

Important notes

  • The folders from which you initially select to search are limited to specified folders (and any of their subfolders) in your home folder, specifically:


~/Desktop
~/Documents
~/Downloads
~/Movies
~/Music
~/Pictures
~/Public

You could add other folders by extending the Scope of the initial file filter but I would strongly recommend not adding folders outside your home folders. If you were to do so search times would probably be very long and you would fail to find system file extensions without significant alterations to the workflow.

  • If the relevant extension is not found you will see something like this:

Notfound.thumb.png.60a91a102b5efc996fe71e123a1624e9.png
You can simply backspace and try another extension (or press esc to end the workflow).

Usage
To run the workflow type fxt (or the other keyword you have set in the user configuration) and you will see this:
Initialdialog.thumb.png.51156f922923b8afa765d547a06c04ae.png
Press space and start typing the name of the folder in which you wish to search. When the name appears in the list you can select it and press ⏎.
Setfolder.thumb.png.4c84f853d93f662e73282ff03174036d.png
You then have the option to search the selected folder and its subfolders (the default) or to search only in the selected folder.

Choose.png.409b1ff1039e840f0f6ab7596b441933.png

When you have made your choice you will see the search dialog (shown here after selecting the default option to search including subfolders):
Search.thumb.png.b42319a658879c2fdde663052352aca1.png
Type the extension for which you wish to search (without the preceding full stop or period) and the result will display:
Result.thumb.png.83fcff881e99424c9ef38178e7d32d16.png
(Remember that you may need to scroll down to see all of the results. In that context you may find it helpful in System Settings → Appearance to show scroll bars Always—which will help make clear where you are in the list of results when moving through it.)

You can select any file found and press:
- ⏎ to open the file;
- ⌥ + ⏎ to reveal the file in Finder; or
- ⇧ + ⏎ to action the file in Alfred.

GitHub download link

 

Edit: I should have said that, as in the case of all my workflows, there are no dependencies.


Stephen

Edited by Stephen_C
Link to comment
  • 1 month later...

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...