快速进入Finder所在路径

之前经常有这个需求,我当前在Finder中打开了某个文件夹,现在需要快速在iterm或terminal中进入这个路径。
最早有一个免费的软件叫go2shell可以实现,后来在最新的Mac OS系统中不可用了。
现在用Apple script 可以实现:

1
tell application "Finder" to set myname to POSIX path of (target of window 1 as alias)

tell application "iTerm"
	activate
	tell current session of current window
		set itext to "cd '" & myname & "'"
		
		write text itext
	end tell
end tell

快速进入Finder所在路径
https://404.ms/2022/07/30/fast-dive-into-current-directory-of-finder/
作者
rocky.xander
发布于
2022年7月30日
许可协议