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

sniffies

macrumors 603
Original poster
Jul 31, 2005
5,650
14,947
somewhere warm, dark, and cozy
I've created an AppleScript. However, the problem is it loads the URL in a new tab every time. Any way to tell it to load in the same tab?

Or any other solution/app?

Your help would be greatly appreciated.

Thank you.
 

numero

macrumors regular
Jul 23, 2002
106
3
OR
AppleScript:
tell application "Safari"
    set theDocument to make new document at end of documents
    set theWindow to window 1
    tell theWindow
        repeat
            set properties of tab 1 to {URL:"http://www.apple.com"}
            delay 60
            set properties of tab 1 to {URL:"http://www.google.com"}
            delay 60
        end repeat
    end tell
end tell
This alternates between URLs just to prove that it works.

Delay value is in seconds. So this example does 1 minute between reloads.

The important part is to grab a reference to the newly created window once it is created. Now you can refer to it even if new windows are created on top of this one.

The repeat loop here will repeat forever.

-numero
 
  • Like
Reactions: cdcastillo
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.