I would like to open 4 Finder windows and position them on my desktop. If possible, I would like to open each windows with another directory.
I had a solution for opening the 4 Finder windows. I was not able to open a specific (always the same) directory. Today for some reason, I get an error message.
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: error "„Finder“ received an error: „bounds of window of desktop“ can n ot be read." number -1728 from bounds of window of desktop