使用Applescript控制Finder的窗口“标签栏”可见性?

时间:2018-07-11 08:57:41

标签: macos applescript finder

Applescript中是否有一种方法可以控制Finder窗口的“标签栏”(不知道英文名称)的可见性?

我知道Applescript可以获取/设置状态栏和工具栏的可见性,但没有发现该“标签栏”的任何内容,该“标签栏”使您拥有多个选项卡式窗口)。

1 个答案:

答案 0 :(得分:0)

此AppleScript代码适用于使用最新版本的macOS Mojave的我。

tell application "Finder"
    activate
    delay 0.1
    if not (exists of window 1) then reveal desktop
    delay 0.1
    tell its window 1
        activate
        repeat until visible
            delay 0.5
        end repeat
        delay 1
        tell application "System Events" to key code 17 using {command down, shift down}
    end tell
end tell

侧注::如果您的Finder窗口1(最前面的Finder窗口)已打开且已打开多个标签,则此代码将不起作用

相关问题