How to step through a smart folder?

Hi -

My question is how can I step through a smart folder created by Spotlight? “Smart folder” isn’t turning up anything useful on the search page.

I’ve got a new pristine MacBook and and an older PowerBook with several thousand .jpgs that I’ve been negligent in organizing through the years, scattered all over, many with identical names, some of which actually are the same images and some are not.

I’ve created a smart folder of these .jpgs with Spotlight and want to write a script to cycle through them all to collect all unique folder paths so I can individually move those folders to the MacBook and sort out dupes later. Or maybe just move the files individually. But in any event I have to step through the smart folder.

Thanks very much.

It would be interesting to see if there is a way to return the “contents” of it, but I’m thinking that might not be directly possible; a Smart Folder is just a saved search - no real files or folders. One alternative is to walk target folders, filtering for the kind property.

Correct.

:frowning:

But I see the smart folder “file” itself is an XML file containing some cryptic info that maybe some App Kit Objective-C calls could make use of - I’ll play around.

Thanks for your responses guys.

Hi,

this is not cryptic at all, the XML source is just the Spotlight search criteria

I didn’t look closely and just assumed it was cryptic. I wrote a perl script this morning to search and move 5000+ jpegs this morning to do it. AppleScript would have been quicker though.

  • Dan