Skip to content

Instantly share code, notes, and snippets.

@yuyangchee98
Created November 4, 2024 08:03
Show Gist options
  • Save yuyangchee98/861633d59a65f0334a89fec42a964088 to your computer and use it in GitHub Desktop.
Save yuyangchee98/861633d59a65f0334a89fec42a964088 to your computer and use it in GitHub Desktop.
How to create a Quick Action in macOS that allows you to right-click any folder and open it directly in Zed editor.

Create Zed Quick Action for macOS

How to create a Quick Action in macOS that allows you to right-click any folder and open it directly in Zed editor.

Quick Action Script

#!/bin/bash

# Get the selected folder path from Automator
for f in "$@"
do
    # Check if the path exists
    if [ -d "$f" ]; then
        # Open Zed with the folder
        /usr/local/bin/zed "$f"
    fi
done

Setup Instructions

  1. Open Automator (you can use Spotlight to find it)
  2. Create a new Quick Action (File > New)
  3. Set "Workflow receives" to folders in Finder
  4. Add a Run Shell Script action (search for it in the actions library)
  5. Copy the script above into the shell script box
  6. Set "Pass input" to as arguments
  7. Save the Quick Action with a name like "Open in Zed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment