Как открыть 4 окна поиска и разместить их на моем рабочем столе - PullRequest
0 голосов
/ 04 ноября 2019

Я хотел бы открыть 4 окна Finder и разместить их на своем рабочем столе. Если возможно, я бы хотел открыть каждое окно с другим каталогом.

У меня было решение открыть 4 окна Finder. Я не смог открыть определенный (всегда один и тот же) каталог. Сегодня по какой-то причине я получаю сообщение об ошибке.

tell application "Finder"

-- get number of open finders
set NumberofFinders to count every Finder window
if NumberofFinders is 0 then
    make new Finder window
    set the target of Finder window 1 to home
end if

-- close all finders except the frontmost one
if NumberofFinders is greater than 1 then
    repeat NumberofFinders - 1 times
        close last Finder window
    end repeat
end if

-- get screen info
set menueBarHeight to 24
set screenBounds to bounds of window of desktop
set screenWidth to item 3 of screenBounds
set screenHeight to (item 4 of screenBounds) - menueBarHeight

-- move finder and set the size
set the bounds of the front Finder window to {screenWidth * 0.5, screenHeight * 0.5 + menueBarHeight, screenWidth, screenHeight + menueBarHeight}

-- make 2nd finder
make new Finder window
set the target of Finder window 2 to home
set the bounds of the front Finder window to {0, screenHeight * 0.5 + menueBarHeight, screenWidth * 0.5, screenHeight + menueBarHeight}

-- make 3nd finder
make new Finder window
set the target of Finder window 3 to home
set the bounds of the front Finder window to {screenWidth * 0.5, screenHeight * 0, screenWidth, screenHeight * 0.5}

-- make 4nd finder
make new Finder window
set the target of Finder window 4 to home
set the bounds of the front Finder window to {0, 0, screenWidth * 0.5, screenHeight * 0.5}
-- bring the finders to the front
activate

end tell

Ergebnis: ошибка: «Finder» получил ошибку: «границы окна рабочего стола« не могут быть прочитаны ». номер -1728 из границ окна рабочего стола

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...