【Mac】Macbook Finder 从当前位置快速打开终端

第一步、新建文件保存成 .scpt 文件

 

set cmd to ""
tell application "Finder"
    set theWindow to window 1
    set thePath to (POSIX path of (target of theWindow as alias))
    set cmd to "cd " & "\"" & thePath & "\""
    
end tell

tell application "Terminal"
    activate
    tell application "System Events" to keystroke "t" using command down

    delay 0.5
    do script cmd in window 1
end tell

第二步、双击打开,另存为 Application 类型,这样就会获得一个 .app 文件,把它拉到 Finder 的工具栏。 

 第三步、获得一个 .app 文件,按住 comand 键,把它拉到 Finder 的工具栏。

第四步、点击按钮能够直接打开终端