您如何在新选项卡(小牛)中复制当前打开的 Finder 视图?

mag*_*goo 8 finder tabs applescript osx-mavericks macos

在这个论坛的一个帖子中,有一个有趣的解决方案,关于如何在 AppleScript 的帮助下打开一个已经打开的 Finder 窗口的副本如何复制当前打开的 Finder 视图?

使用 OS X 10.9 Mavericks 中新的标签式 Finder,我想知道是否有办法实现 AppleScript,在新的 Finder 选项卡而不是新的 Finder 窗口中打开副本?有没有人成功找到解决方案?

小智 16

您可以通过按:

cmd+ctrl+O

在任何文件夹上,它将显示在新选项卡中。

  • 这将在新选项卡中打开*选定的*文件夹。但是,只有在选中“Finder 首选项 > 在选项卡中打开文件夹而不是在新窗口中打开文件夹”选项时,此功能才有效。否则,它将在新窗口而不是新选项卡中打开选定的文件夹。同样,这基于*选定的*文件夹 - 而不是选项卡/窗口当前打开的位置。如果没有选择文件夹,它根本不起作用。因此从技术上讲,这并不能回答所发布的问题。 (2认同)

Lri*_*Lri 6

Finder 的字典不支持制表符,但您可以模拟按下 command-T:

tell application "Finder"
    activate
    set t to target of Finder window 1
    set toolbar visible of window 1 to true
end tell
tell application "System Events"
    keystroke "t" using command down
end tell
tell application "Finder"
    set target of Finder window 1 to t
end tell
Run Code Online (Sandbox Code Playgroud)

Finder 窗口的目标是标题栏上显示的文件夹,这与在列表视图中选择的项目无关。