-
Star
(294)
You must be signed in to star a gist -
Fork
(52)
You must be signed in to fork a gist
-
-
Save tonysneed/f9f09bfa28bcf98e8d8306f9b21f99e2 to your computer and use it in GitHub Desktop.
- 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" |
updated for Big Sur (doesn't run a script, picks the app's icon) https://gist.github.com/aamnah/9b66ab2462e1b50358455dbd3c9c2f0f
Thank you so much
![]()
it dosen't work
i had the same problem try this:
https://brianli.com/how-to-fix-automator-operation-not-permitted-error-in-macos-catalina/
wow...thanks man, still works with Mojave.
This is great, thanks!
Brilliant! Thanks
Still works in MacOS Sonoma Mar 2024. Thank you! The "Quick Action" tip from above still applies.
In 2025, for MacOS Sonoma 14.4.1, I adapt it to behave like "Open in Cursor", and it works.
Use the following steps,
- Open Automator
- File > New
- Select Quick Action
- Click Choose
- Select "Workflow receives current files or folders in Finder"
- From the left hand side pane in Automator, drag-drop Library > Utilities > Run Shell Script into the right hand pane
- Ensure Pass input is set to "as arguments"
- Then paste the below text:
for f in "$@"
do
open -n -a "Cursor.app" --args "$f"
done
Then,
- Click File > Save
- Give name as "Open in Cursor"
- Go to Finder, select a folder or files, right click > choose Quick Actions > Open In Cursor
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.
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.
- Open Automator
- File > New
- Select Quick Action
- Search for "Open Finder Items" and drag it to the right panel
- Set "Workflow receives current" value to "Automatic (files or folders)" in "any application"
- Under Open Finder Items, change Open with: "Default Application" to Open with: "Cursor.app"
- Save with a custom name (e.g., Open with CursorAI)
Thanks for this!
Here's an update for Catalina, since Automator has changed a bit over time...
After saving, it should be available on any folder in Finder under the menu Services