hey, there are some useful expressions you can use..
viewportright("layername")
Returns the x coordinate of the far right edge of whichever layer, regardless of a resized window.
and as you've probably guessed there is viewportbottom / left / top aswell