Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MagicTramp

macrumors newbie
Original poster
Jan 14, 2009
19
0
I use Safari on my second monitor.
Every now and then i drag the window down to my MBP screen, then need to drag it back up to my second monitor; stretching it etc. until it fits the screen.

ANNOYING!

I need an applescript to tell the safari window to move up to the second monitor and fit the screen.

I have a similar script for FInder. One script takes a 'stamp' of the finder window size, and another script recalls that size. However the 'stamp' script (when i change all "Finder" words to Safari) cannot compile. Here it is...

set PrefsPath to (path to preferences as text)

do shell script ("mkdir -p " & quoted form of POSIX path of (PrefsPath & "FinderSize"))

set dataFilePath to PrefsPath & "FinderSize:Finder Window Bounds.dat"

tell application "Finder" to set FinderWindowOpen to ((count each Finder window) > 0)

if (FinderWindowOpen) then
tell application "Finder" to set theBounds to bounds of front Finder window

set fRef to (open for access file dataFilePath with write permission)
try
set eof fRef to 0
write theBounds to fRef
end try
close access fRef
end if

Can i make this work for Safari? Or is there an easier way? Thanks! :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.