在启动台中找到自动操作并打开

 

选择快速操作

 

将“工作流程收到”设置为“没有输入”;然后将左侧的“运行AppleScript”拖到右侧

 

 在右侧代码处替换如下的代码

该代码是在桌面打开终端,所处的路径是 ~

on run {input, parameters}
	
	(* Your script goes here *)
	tell application "Terminal"
		reopen
	end tell
end run

 

 可以点击运行开是否能执行成功,之后“command+s”保存并命名为open terminal

提供第二种打开方式,可在任意位置打开终端

on run {input, parameters}
	tell application "Finder"
		set myWin to window 1
		set thePath to (quoted form of POSIX path of (target of myWin as alias))
		if application "Terminal" is running then
			tell application "Terminal"
				do script "cd " & thePath
				activate
			end tell
		else
			tell application "Terminal"
				do script "cd " & thePath in window 1
				activate
			end tell
		end if
	end tell
end run

 保存后可命名为open terminal here

之后打开 系统偏好——>键盘——>快捷键

在左侧选择服务,右侧通用处找到刚刚命名的两个文件,然后设置喜欢的快捷键即可

 

 

2021-06-11  16:33:06