macOS show “Open in VS Code” icon and “Open in Terminal” icon in Finder All In One
Open Folder in VS Code code .
Open
Automator.app
PickApplication
- Run Shell Script
finderPath=`osascript -e 'tell application "Finder" to get the POSIX path of (target of front window as alias)'`
open -n -a "Visual Studio Code" --args "$finderPath"
- App Bundle ID
finderPath=`osascript -e 'tell application "Finder" to get the POSIX path of (target of front window as alias)'`
open -n -b "com.microsoft.VSCode" --args "$finderPath"
Open Folder in Terminal
Open
Automator.app
PickApplication
- Run AppleScript
on run {input, parameters}
tell application "Finder"
set myPath to (POSIX path of (target of front window as alias))
end tell
tell application "Terminal"
do script "cd " & myPath
activate
end tell
return input
end run
- Run Shell Script
osascript -e '
tell application "Finder"
set myPath to (POSIX path of (target of front window as alias))
end tell
tell application "Terminal"
do script "cd " & myPath
activate
end tell
'