Finding OSA scripts with Spotlight
With the release of Script Debugger 4.0, I added a Spotlight searching capability for OSA scripts created with Script Debugger. Based on a series of customer support emails I realized that this is not a well documented aspect of the product. Here is a quick overview of how to use Script Debugger Spotlight support to find OSA scripts on your Macintosh.
NOTE: Spotlight indexing of OSA scripts only works for scripts that have beenn saved using Script Debugger. Scripts created with Apple’s Script Editor are not indexed.
Script Debugger provides indexing information for three aspects of your OSA scripts:
the source text of the script (kMDItemTextContent)
the script’s description (kMDItemDescription)
the script’s language name (kMDItemKeywords) which is normally “AppleScript”
Here some ways to find all the scripts on your Macintosh which target the Apple Mail application. First, we’ll search for documents containing “Mail” and with the AppleScript keyword:
This is good, but we get some documents that are not scripts. Instead, we’ll search for OSA scripts that contain “Mail”:
Perfect, all the OSA scripts on my machine that target the Apple Mail application.