AppleScripts for multiple windows and locations in a browser
(See below for an additional script submitted by Cheshirekat)
These scripts will launch your browser and open a new window for each of the listed URL's. They can be used as a simple way to make your browser an "off-line" reader.
To use the scripts, launch Apple's Script Editor and paste them into a new document window. Do a "Save As..." and from the popup menu select Application and check Never Show Startup Screen. You can, of course, change the URL's to your favorites.
Netscape:
tell application "Netscape Communicator" -- Make sure the name matches yours exactly!
activate
OpenURL "http://www.macnn.com" -- first window opens by default
make new document
OpenURL "http://www.macplaza.net" -- to Window 2
make new document
OpenURL "http://www.ResExcellence.com" --to Window 3
end tell
Internet Explorer:
tell application "Internet Explorer 4.01" -- Make sure the name matches yours exactly!
Activate
OpenURL "http://www.macnn.com" toWindow 1
OpenURL "http://www.macplaza.net" toWindow 2
OpenURL "http://www.ResExcellence.com" toWindow 3
end tell
An addition script submitted by Cheshirekat. It has the advantage of setting window placement.
-- Replace with your own URLs between the quote marks in the next line
-- Add more if you wish
property myURLList : ¬ -- That little sidways L is a soft carriage return (option-return)
{"http://www.versiontracker.com/", "http://www.macintouch.com/", "http://www.resexcellence.com/"}
repeat with xUrL in myURLList
-- make sure that the name matches the name of your browser exactly
-- "window 0" apparently means a new window - I found this out by accident
-- this is useful as a launch script
tell application "Netscape Communicator" to OpenURL xUrL toWindow 0
end repeat
-- All of the below can be deleted if you don't have a preference to your window size
-- and the positions of your windows
-- this works best as a script application because you can have the script
-- set window positions as it quits when done processing the above URLs
-- but I thought I'd just provide the basics if it is of interest
tell application "Netscape Communicator"
activate
set xNum to 1
-- below finds out how many windows are open in case there are lots of
URLs
set theWindows to list windows
repeat with xWin from 1 to (count theWindows)
-- first number is position from left edge of screen
-- second number sets position from under the menubar
-- third number sets window height
-- fourth number sets window width
-- this can vary depending on monitor and resolution, personal preference
if xNum is in {1, 3, 5, 7, 9, 11, 13, 15} then
set position of window xWin to {10, 40, 450, 600}
else
set position of window xWin to {80, 40, 450, 600}
end if
set xNum to xNum + 1
end repeat
end tell |