首页 > 其他分享 >macOS show “Open Folder in VS Code” icon and “Open Folder in Terminal” icon in Finder All In One

macOS show “Open Folder in VS Code” icon and “Open Folder in Terminal” icon in Finder All In One

时间:2023-01-29 20:56:28浏览次数:53  
标签:Terminal Folder Open tell Finder icon

macOS show “Open in VS Code” icon and “Open in Terminal” icon in Finder All In One

image

Open Folder in VS Code code .

Open Automator.app Pick Application

  1. 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"
  1. 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 Pick Application

image

  1. 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
  1. 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
'

(

标签:Terminal,Folder,Open,tell,Finder,icon
From: https://www.cnblogs.com/xgqfrms/p/17073792.html

相关文章