Which confused me, because I found it on my Mojave machine...
I think it just hasn't made it into the man page. Going back through the Terminal history it appears I stumbled on it by typing mdfind without any arguments, and the -s option appears in the Usage message.
It's not listed in the man page, but it is listed in the help:
$> mdfind -h
-attr <attr> Fetches the value of the specified attribute
-count Query only reports matching items count
-onlyin <dir> Search only within given directory
-live Query should stay active
-name <name> Search on file name only
-reprint Reprint results on live update
-s <name> Show contents of smart folder <name>
-0 Use NUL (``\0'') as a path separator, for use with xargs -0.
mdfind -h
Usage: mdfind [-live] [-count] [-onlyin directory] [-name fileName | -s smartFolderName | query]
list the files matching the query
query can be an expression or a sequence of words
-attr <attr> Fetches the value of the specified attribute
-count Query only reports matching items count
-onlyin <dir> Search only within given directory
-live Query should stay active
-name <name> Search on file name only
-reprint Reprint results on live update
-s <name> Show contents of smart folder <name>
-0 Use NUL (``\0'') as a path separator, for use with xargs -0.
example: mdfind image
example: mdfind -onlyin ~ image
example: mdfind -name stdlib.h
example: mdfind "kMDItemAuthor == '*MyFavoriteAuthor*'"
example: mdfind -live MyFavoriteAuthor
No, it isn't. I'll try and find a "standard install" machine next week, just in case it's a tweak from the Xcode Command Line Tools (which I'm guessing yourself and @unlocked2412 have installed, but @noisneil may not).
It wouldn't. I'm partly scratching the itch I always get when a seemingly simple command works on one machine but not another, but also this would be a quick way to compare the contents of your Smart Folder to determine what had been untagged and so was due for removal from Dropbox -- that could be done on a periodic basis or as part of your macro. In pseudo-code
do shell script 'mdfind -s "smartFolder"' saving results to Local_taggedFiles
repeat with each item Dropbox location
if (munged path to item) is not in Local_taggedFiles then delete item
end repeat
Comparing the Dropbox path to the original path would take some fiddling, but I'm assuming that since you've macroed the copying there would be consistent placement on that end -- so it would "just" be determining the relevant portion of the original's path to compare against.
I've already managed it using the comments hack, which is the only way I could think of, given that the tagged folders aren't actually being copied but the files-of-type within them.