I want to create a Smart Folder which just lists all files of my ~/Music
directory - i.e. just a flattened version of that folder.
How can I do this?
(I tried to type *
in the search field, but that doesn't list all files.)
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this communityI want to create a Smart Folder which just lists all files of my ~/Music
directory - i.e. just a flattened version of that folder.
How can I do this?
(I tried to type *
in the search field, but that doesn't list all files.)
By default, the Spotlight GUI in the Finder will not let you use wildcards or other advanced syntax. However, by using the Raw Query
search criterion, you can use all the syntax available to the command-line mdfind
utility:
Raw Query
criterion is visible (it isn't by default). If not, click Other...
and a criteria list will appear. Search for the Raw Query
criterion, check the box to include it in the menu, and click "OK".Select the newly-visible Raw Query
criterion and enter the following:
(kMDItemFSName == '*.mp3') || (kMDItemFSName == '*.ogg') || (kMDItemFSName == '*.flac')
The above query will search for files that have .mp3, .ogg, or .flac in their filename (as opposed to the contents of the file). This Macworld article helped me construct this particular query, but this Apple Developer page has a more comprehensive listing of the types of metadata available for raw queries.
Alternatively, you can construct the desired query visually:
Kind
criterion and set it to Any
Option/Alt
key to create a conditional (thanks to Adam Franco for pointing this out) and set it to Any
File extension
criterion is visible. If not, click Other...
and a criteria list will appear. Search for the File extension
criterion, check the box to include it in the menu, and click "OK".File extension
criteria as you wish.If you want the search to display all files below a given folder (regardless of file type), you can use the File visibility
criterion:
File visibility
criterion is visible (it isn't by default). If not, click Other...
and a criteria list will appear. Search for the File invisible
criterion, check the box to include it in the menu, and click "OK".File visibility
option should now be in the search criterion drop-down menu. So long as this criterion is set to "Visible or Invisible", all files below the present folder will be shown (you can optionally change this to "Visible Items" you don't want dot-files in the results)/
" but it didn't worked.
*.{mp3,ogg,flac}
files?
It looks like just typing a . in the search field shows all files, but not folders.
.
in its name (i.e. no file extension). And probably it shows also the folders which have a .
in its name.
I know you want a smart folder, but in the absence of that, you can use Terminal:
ls -R ~/Music
This will give you a list, but I think what you want is to be able to see the files and access them directly.
Am I missing something, but this seems really simple:
UPDATE:
Here's v2 where I just set it to File Size is greater than 0KB and get all files in the Music folder
~/Music
was mostly just an example).