如何在当前查找程序窗口中打开文件夹?


0

我知道tell application "Finder" to open POSIX file "/folder/path/"将打开一个新的查找程序窗口,如何在当前查找程序窗口中打开一个文件夹?

Answers:


1

我自己找到了答案:

tell application "Finder"
    set the target of the front Finder window to (POSIX file "/folder/path/")
end tell

1

如果您还想在没有打开的Finder窗口时打开新的Finder窗口(或仅例如打开一个首选项窗口),请使用以下reopen命令:

tell application "Finder"
    reopen
    set target of Finder window 1 to (POSIX file "/tmp/")
end tell
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.