Skip to content

Instantly share code, notes, and snippets.

@tonysneed
Last active March 29, 2025 18:40
Show Gist options
  • Save tonysneed/f9f09bfa28bcf98e8d8306f9b21f99e2 to your computer and use it in GitHub Desktop.
Save tonysneed/f9f09bfa28bcf98e8d8306f9b21f99e2 to your computer and use it in GitHub Desktop.
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@xc1427
Copy link

xc1427 commented Feb 6, 2025

But If somebody can fork this OpenInCode project and makes it work for cursor, I will highly appreciate it.

I have tried and haven't figured it out, but its code is relatively simple.

@jaekookang
Copy link

Thanks to @xc1427 for sharing the method using the shell script.
I rather used simply Automator's built-in feature without using the shell script.
Let me share it here if it helps.

  1. Open Automator
  2. File > New
  3. Select Quick Action
  4. Search for "Open Finder Items" and drag it to the right panel
  5. Set "Workflow receives current" value to "Automatic (files or folders)" in "any application"
  6. Under Open Finder Items, change Open with: "Default Application" to Open with: "Cursor.app"
  7. Save with a custom name (e.g., Open with CursorAI)

sh2_250206
sh_250206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment