Skip to content
Various automation Scripts for Spotlight in macOS to execute.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Various automation scripts for use with macOS' Spotlight.


git clone /Applications/

You can of course replace /Applications/ with any path of your choosing provided you haven't told Spotlight not to index that path.


You can place them in any directory that Spotlight indexes for easy execution with Spotlight in macOS.

This was created in order to make Spotlight behave slightly more like Alfred. The scripts use the new JavaScript for Automation in macOS.


  1. Switches to the user account switcher and password locks the account.
  2. Opens most used apps. Customizable by editing the main.scpt.
  3. Quits all of the above apps opened by
  4. Opens MacVim. No need to symlink MacVim to the /Applications directory.
  5. Quickly create and open a new Swift Playground file.
  6. Empty the trash. Caution: Currently shows no alert dialog.
  7. Open Chrome in birthday shopping mode. If it's already open, switches to it.
  8. Toggle between "Automatic graphics switching" setting in System Preferences. Gives you a notification when switched.
  9. Toggles between standard function keys and Apple function key modes. Gives you a notification when switched.
  10. Copies the macOS version information which includes the build number.
  11. Opens pointed at the current Finder window's path. Can also be used on the Desktop itself! Note: If you want to open instead, edit the main.scpt file for this application.
  12. Messy Desktop? Move all the folders and files (excluding the hidden ones) from ~/Desktop to ~/Downloads instead


Why not just use Alfred/Quicksilver?

Spotlight comes built in, is free, and can do most of what Alfred or Quicksilver can do. Alfred charges for extra workflow features and it actually relies on Spotlight's engine and metadata it creates for most of the heavy lifting. Most people just want a app launcher with some workflow features. The Spotlight in macOS is more accurate in opening apps, and can even do conversions. So why not write automation scripts for it to execute?


Copyright © 2015-2017 Akshay Hegde

This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details.

You can’t perform that action at this time.