I have a camera setup were the camera automatically takes pictures every x seconds and these images are saved in a directory called 'Images'. Now I want to create a smart folder that looks in 'Images' and only lists images that were added in the last 5 minutes. When creating a smart folder, I see only the option the list files from the last day.
How can I create a smart folder that lists only files created in the last 5 minutes?
In other words, I want to create a smart folder using non-standard options.
Best Answer
A 'Smart folder' is in principle a XML formatted file that, when opened, returns a Spotlight search result. To create a Smart folder you can add multiple search terms by pressing the
+
(or alt+
). For example, you can choose to only return files that where created in the last 7 days. Although there is a profusion of search terms, some are still missing (like searching within the last 5 minutes).The commandline version of Spotlight is
mdfind
(manual). Although harder to use,mdfind
commands are more flexable than the Smart folder/Spotlight alternative. You can, for example, search for files that were created in the last 5 minutes like this:Or were changed in the last 10 minutes:
Fortunatly Smart folders support the
mdfind
command! To usemdfind
search commands do the following:In the search-items bar you can select 'Other...' from the drop down menu. Search for 'Raw query' and add it to your search terms
Now enter your
mdfind
search query in the empty text fieldSave your search and you are done.