macOS show “Open Folder in VS Code” icon and “Open Folder in Terminal” icon in Finder All In One
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
'
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
refs
https://flaviocopes.com/how-to-add-an-open-in-terminal-icon-in-macos-finder/
https://flaviocopes.com/how-to-add-an-open-in-vs-code-icon-in-macos-finder/
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/17073792.html
未经授权禁止转载,违者必究!