Spotlight doesn’t index playground contents. This is a source of endless frustration to me and today I finally had enough. I wrote this. It performs a spotlight search for playground bundles and then manually greps their contents for search phrases. Let me know if anyone finds it useful. And please file a radar. I don’t want mine to be lonely.
I also set up a bunch of smart folders to help me find things.
The first two list all playgrounds and all swift files on my Mac. The second two show any playgrounds and swift files I’ve opened today. There isn’t overlap because swift files within playgrounds aren’t indexed.
Create smart folders by opening a Finder window. Type Command-F. Enter search criteria and then click Save.
Today’s two main.swift files are from this morning’s “eval” example and this evening’s “pggrep”. None of my work on playgrounds today shows up in the search.
Compare with the “Today’s Playgrounds” results: