Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 30, 2009, 08:47 AM   #1
MagicTramp
macrumors newbie
 
Join Date: Jan 2009
Applescript to move Safari window to second monitor!

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...

Quote:
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!
MagicTramp is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Safari 6 Activity window - make your move eXan Mac Applications and Mac App Store 9 Aug 23, 2012 04:01 PM
Keep a window always on top - can't find an app. How can I applescript this? Hippocrates04 Mac Basics and Help 0 Aug 5, 2012 09:36 AM
applescript leaves terminal window open Zeke D Mac Programming 6 Jul 22, 2012 02:44 PM
How To Move Window To Another Desktop macNewbie02 MacBook Pro 8 Jul 22, 2012 02:20 PM
Window flickers in Safari when resizing window Pegbiter OS X 0 Jun 13, 2012 08:14 AM

Forum Jump

All times are GMT -5. The time now is 10:55 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC