Applescript:我如何在所有Finder窗口上执行操作,仅在当前桌面?

时间:2014-02-19 22:58:25

标签: applescript

在Mountain Lion上,我正在尝试创建一个AppleScript应用程序来调整当前桌面(又称空间)中所有Finder窗口的大小。

我想简单地导航到有问题的空间,点击一个应用,然后将所有打开的Finder窗口(仅限该空间)调整为固定大小。

我有一个脚本可以完成我需要的操作,但它可以在所有空间的每个Finder窗口上运行。 如何将其限制在当前空间?谢谢。

tell application "Finder"
set theFolders to folder of every window
set theBounds to {10, 10, 310, 310}

repeat with aFolder in theFolders
    tell container window of aFolder
        set toolbar visible to false
            set bounds to theBounds
    end tell
end repeat
end tell

此代码将窗口堆叠在一起。那不是问题。我知道如果我想要如何级联,但我目前更喜欢使用“divvy”手动定位它们。

我正在运行此调整大小代码以解决Mountain Lion“功能”,该功能限制了最小Finder窗口宽度以及与侧面板工具栏的交互。这段代码完成了我想要的,只是在太多的窗口上。

0 个答案:

没有答案
相关问题