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

问题描述 投票:0回答:1

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

我知道Applescript可以获取/设置状态栏和工具栏可见性,但没有发现这个“标签栏”,这个标签栏可以让你有多个标签窗口)。

macos applescript finder
1个回答
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

SIDE-NOTE:如果您的Finder窗口1(最前面的查找器窗口)打开且已打开多个选项卡,则此代码将不起作用

© www.soinside.com 2019 - 2024. All rights reserved.