我知道tell application "Finder" to open POSIX file "/folder/path/"
会开一个新的Finder 窗口中,如何打开文件夹当前的查找器窗口?
答案1
我自己找到了答案:
tell application "Finder"
set the target of the front Finder window to (POSIX file "/folder/path/")
end tell
答案2
如果您还想在没有打开的 Finder 窗口(或者例如仅打开了一个首选项窗口)的情况下打开一个新的 Finder 窗口,请使用以下命令reopen
:
tell application "Finder"
reopen
set target of Finder window 1 to (POSIX file "/tmp/")
end tell