You need to be logged in to post in the forums. If you do not have an account, please sign up first.
Arrange Opera windows Horizontally or Vertically (AppleScripts)
If you want to arrange Opera windows horizontally or vertically you can use this two scripts. They was originally written from LXMORJ for Safari. I adapted them for Opera.They work quite well on Opera, but you have to run them twice. I can't understand why this happens
Perhaps somebody here can explain that?Arrange Vertically:
tell application "Opera"
set allWindows to (every window)
set n to count of allWindows
-- Determine screen size of your machine
tell application "Finder"
set screenSize to bounds of window of desktop
set screenWidth to item 3 of screenSize
set screenHeight to item 4 of screenSize
end tell
-- Dividing by zero is bad
if n is equal to 0 then return
set windowWidth to screenWidth / n
-- unsure if this will differ for monitor size. If there is a gap between windows, reduce adjustment. If there is overlap, increase it.
set adjustment to 10
if (n > 0) then
activate
set x to 1
-- Position each window in turn
repeat
tell window x
set bounds to {windowWidth * (x - 1), 0, windowWidth * x, screenHeight}
end tell
set x to x + 1
if x is equal to (n + 1) then exit repeat
end repeat
end if
end tell
Arrange Horizontally:
tell application "Opera"
set allWindows to (every window)
set n to count of allWindows
-- Determine screen size of your machine
tell application "Finder"
set screenSize to bounds of window of desktop
set screenWidth to item 3 of screenSize
set screenHeight to item 4 of screenSize
end tell
-- Dividing by zero is bad
if n is equal to 0 then return
set windowHeight to screenHeight / n
-- unsure if this will differ for monitor size. If there is a gap between windows, reduce adjustment. If there is overlap, increase it.
set adjustment to 22
if (n > 0) then
activate
set x to 1
-- Position each window in turn
repeat
tell window x
set bounds to {0, windowHeight * (x - 1) + adjustment, screenWidth, windowHeight * x}
end tell
set x to x + 1
if x is equal to (n + 1) then exit repeat
end repeat
end if
end tell