Posts with tag macos

create a quick action to open folder in terminal

2024-05-14
macososservice快速操作,服务,终端

os: mac14.5create a quick action to open folder in terminal创建快速操作以右键在终端中打开文件夹打开 Automator app,又称自动操作新建文件在“选取文稿类型”窗口中选择“快速操作”,点击“选取”在左侧栏目中拖拽“实用工具 - 运行 Apple Script”到右侧空白处在顶部栏目中选择“工作流程接收到 自动(无)” “位于 访达.app”添加以下脚本:on run {input, parameters} tell application "Finder" set currentFolder to (folder of the front window as alias) end tell tell application "iTerm" activate try set currentSession to current session of current window on error create window with default profile set currentSession to current session of current window end try tell currentSession write text "cd " & quoted form of POSIX path of currentFolder end tell end tell return input end run保存取个名字killall Finder 重启 Finder 后,右键一个文件夹,在“快速操作”栏目中寻找是否有对应服务。Optional在设置 - 键盘 - 键盘快捷键 - 服务 - 通用 中为你的服务增加快捷键,(双击快捷键图标后键入新快捷键)比如 cmd +

No more posts to load.