Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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"
@merken
Copy link

merken commented Jan 12, 2021

Thanks for this!

Here's an update for Catalina, since Automator has changed a bit over time...

  • Open Automator
  • File -> New -> Quick Action
  • Change "Workflow Receives current" 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"

After saving, it should be available on any folder in Finder under the menu Services

@aamnah
Copy link

aamnah commented Feb 26, 2021

updated for Big Sur (doesn't run a script, picks the app's icon) https://gist.github.com/aamnah/9b66ab2462e1b50358455dbd3c9c2f0f

@cybersasi
Copy link

cybersasi commented Apr 19, 2021

Thank you so much

@TugbaK0619
Copy link

TugbaK0619 commented Oct 28, 2021

Screen Shot 2021-10-27 at 8 45 19 PM

it dosen't work

@TugbaK0619
Copy link

TugbaK0619 commented Oct 28, 2021

Screen Shot 2021-10-27 at 8 46 47 PM

it dosen't work

@halataa
Copy link

halataa commented Nov 7, 2021

@adeguntoro
Copy link

adeguntoro commented Jul 30, 2022

wow...thanks man, still works with Mojave.

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