Skip to content

Instantly share code, notes, and snippets.

@ahgraber
Last active February 25, 2022 14:43
Show Gist options
  • Save ahgraber/9e21eb731e2cc189439653477b322870 to your computer and use it in GitHub Desktop.
Save ahgraber/9e21eb731e2cc189439653477b322870 to your computer and use it in GitHub Desktop.
Open folder in VSCode

Steps

  1. Launch Automator

  2. Create New Document

  3. Create a new Quick Action (Select "Quick Action")

  4. Add the Action Workflow receives current files or folders in Finder

  5. If desired, add custom image/icon (see comment below)

  6. Add a new Run Shell Script action to the workflow.

  7. Configure the Workflow

    1. Set the Pass Input to be as arguments

    2. Paste the following in the input box:

      open -n -b "com.microsoft.VSCode" --args "$*" 
  8. Save the action using a name like Open In Visual Studio Code

  9. If icon does not show, relaunch Finder: hold cmd + opt + right-click Finder icon > relaunch

Use

Right-click a file or folder, find your newly created task under Quick Actions

Reference

Ref: https://stackoverflow.com/questions/64040393/open-a-folder-in-vscode-through-finder-in-macos

@ahgraber
Copy link
Author

Screenshot

@ahgraber
Copy link
Author

ahgraber commented Feb 25, 2022

Custom icon

  1. Download image below
  2. Image > choose > /path/to/icon.png

Code

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