Applescript方法来控制合并的Finder窗口中选项卡的顺序



试图在合并的Finder窗口中找到控制选项卡顺序的Applescript方法。我正在使用此脚本合并文件夹窗口:

tell application "System Events"
    click menu item "Merge All Windows" of menu "Window" of menu bar item "Window" of menu bar 1 of application process "Finder" of application    "System Events"
end tell

谢谢你的帮助!

正如@pbell所提到的,在合并窗口之前应该对它们进行排序。这里有一个小片段,对三个打开的窗口(桌面、应用程序、文档)进行排序,展示了它如何为您工作。

set windowsFromBackToFront to {"Desktop", "Applications", "Documents"}
repeat with aWindowName in windowsFromBackToFront
    tell application "Finder"
        try
            set index of window aWindowName to 1
        end try
    end tell
end repeat
tell application "System Events"
    click menu item "Merge All Windows" of menu "Window" of menu bar item "Window" of menu bar 1 of application process "Finder" of application "System Events"
end tell

这对你来说应该是一个很好的起点。应该很容易更改脚本以匹配您的查找窗口。

致问候,Michael/Hamburg

最新更新