Like mdfind -live, but useful
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
Makefile
QueryListener.h
QueryListener.m
README.md
main.m

README.md

mdlisten

mdlisten(1) is a command-line utility to issue long-running Spotlight queries from the command line. It’s like mdfind(1) with the -live option except that it outputs the absolute path of new results instead of aggregating them into a useless count.

Install

Run make and then make install. By default it installs to /usr/local, install with a customized PREFIX like make install PREFIX=/opt to change the install location.

Usage

mdlisten <query>

Example

Upload screenshots to your web host as you take them.

mdlisten kMDItemIsScreenCapture = 1 | while read -r filename; do
    scp "$filename" you@domain.com:/var/www/domain.com/screenshots
done