mdScriptFilter is a command-line tool to search the macOS Spotlight database, similar to mdfind
, and return JSON suitable for Alfred’s Script Filter Input and Grid View.
Download the latest release and include it in your Alfred workflow. The executable is signed and notarised.
Queries in mdScriptFilter use the same syntax as metadata queries in mdfind
. Run mdscriptfilter --help
to see available options and defaults.
A couple of examples of doing the same search with both tools:
mdfind 'kMDItemIsScreenCapture == 1' -onlyin ~/Desktop
mdscriptfilter 'kMDItemIsScreenCapture == 1' --positive-scope ~/Desktop
mdfind 'kMDItemTextContent == "fruits and vegetables" && kMDItemContentType == "com.adobe.pdf"'
mdscriptfilter 'kMDItemTextContent == "fruits and vegetables" && kMDItemContentType == "com.adobe.pdf"'
Use the build in the releases if you want to use mdScripFilter in a workflow. To build it yourself for development:
# Clone the repository
git clone git@github.com:vitorgalvao/mdscriptfilter.git
# Change to directory
cd mdscriptfilter
# Build
swift build --configuration release --arch arm64 --arch x86_64
The output binary will be in the same directory, under .build/apple/Products/Release
.
3-Clause BSD