-
-
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" |
I works for me.
Thanks :)
Great!! Thanks a lot!
This should solve all your problems.
https://github.com/Mortennn/FiScript
Awesome! Thanks you very match!
Awesome! Thanks bro,
Action Same for Sublime Text:
shell script box:
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -a "$@"
cool, thanks !
To make it even easier add a shortcut to this service Command + .
System Preferences->Keyboard->Shortcuts->Services->Open with Visual Studio Code->Add->'Command' + '.' ->Save
Now in finder select a file or folder and press COMMAND + .
Have fun :)
Very cool thanks!!!!
Thnx!
Just brilliant. Thanks
For newbies like me, the 'Service' in automator is now called 'Quick Action'. The rest of the steps work fine.
Thank you very much!
This is brill, thank you!
For Mojave, 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 -b "com.microsoft.VSCode" --args "$f"
done
- Click File > Save
- Give name as "Open in VS Code"
- Go to Finder, select a folder or files, right click > choose Quick Actions > Open In VS Code
saved my day ;-) thx
This looks super amazing. Thanks!
For Mojave, 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 -b "com.microsoft.VSCode" --args "$f"
done
- Click File > Save
- Give name as "Open in VS Code"
- Go to Finder, select a folder or files, right click > choose Quick Actions > Open In VS Code
Worked like a charm, thank you.
Everybody, you can just go to applications and cmd+click VS Code's application onto the top bar, which will allow you to drag folders onto it to open them into VSCode. No automator necessary. This also works for iTerm2.
Feel like this one got overlooked, but is by far the best approach IMO. Thanks @mattwaler
Everybody, you can just go to applications and cmd+click VS Code's application onto the top bar, which will allow you to drag folders onto it to open them into VSCode. No automator necessary. This also works for iTerm2.
Feel like this one got overlooked, but is by far the best approach IMO. Thanks @mattwaler
Oh you are hero! Simple and powerful
This is great, thanks for your help!
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
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.
Automator menu is changed and I cannot follow the tutorial. Can some one please update the workflow?