mac book 访达新增一个到当前目录快捷按钮
Linux 2025/9/5 21:03:46 点击:不统计
http://%77%77%77%2E%66%6F%72%61%73%70%2E%63%6E
在自己系统的访达中原来有个Go2shell 的快捷按钮小软件,但是,它没有arm M系列芯片版本,只有intel的。
下面是 手动生成一个 对应的 小app 。我的终端是Iterm2 的。
1. 生成app 一键安装脚本
bash -c 'APPDIR="$HOME/Applications/cdto-iTerm2.app/Contents"; \
mkdir -p "$APPDIR/MacOS" "$APPDIR/Resources"; \
cat > "$APPDIR/Info.plist" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>applet</string>
<key>CFBundleIdentifier</key>
<string>com.custom.cdtoiTerm2</string>
<key>CFBundleName</key>
<string>cdto-iTerm2</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
</dict>
</plist>
EOF
cat > "$APPDIR/MacOS/applet" <<EOF
#!/usr/bin/osascript
on run
tell application "Finder"
try
set currentDir to POSIX path of (target of front window as alias)
on error
set currentDir to POSIX path of (desktop as alias)
end try
end tell
tell application "iTerm"
activate
try
tell current window
create tab with default profile
tell current session to write text "cd " & quoted form of currentDir
end tell
on error
set newWindow to (create window with default profile)
tell current session of newWindow
write text "cd " & quoted form of currentDir
end tell
end try
end tell
end run
EOF
chmod +x "$APPDIR/MacOS/applet"; \
echo "✅ cdto-iTerm2.app 已安装到 ~/Applications,可以拖到 Finder 工具栏使用!"'
第二步 上面是安装到本地应用,并不是系统应用
mv ~/Applications/cdto-iTerm2.app /Applications/
第三步 更改icon 图标
下载 一个icns 格式的图标,并复制。
将 应用中 看到 cdto-iTerm2 在简介窗口左上角 点一下小图标 → ⌘ + V 粘贴。
这里下载一个:下载icons
第四部 将应用放到 你的访达任务标签中
按着 ⌘ + 选中应用的 cdto-iTerm2 拖动到 访达菜单即可。
·上一篇:查看pid进程信息 >> ·下一篇:网站制作学习网