Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8305633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:09:21+00:00 2026-06-08T18:09:21+00:00

How do you open a new window in safari and then open multiple tabs

  • 0

How do you open a new window in safari and then open multiple tabs with different urls in that window using apple script?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:09:22+00:00Added an answer on June 8, 2026 at 6:09 pm

    The way to create a new window in Safari is to use the make new document command:

    make new document at end of documents with properties {URL:the_url}
    

    This will create a new window with a single tab pointing to the_url and make that window frontmost. Note that make new window at end of windows doesn’t work, and just errors out with “AppleEvent handler fails”.

    Similarly, to create a new tab within a window w, you can use make new tab:

    make new tab at end of tabs of w with properties {URL:the_url}
    

    This will create a new tab in window w at the end of the list of tabs; this tab will be pointing to the_url, and it won’t be the current tab. Instead of explicitly saying tabs of w, you can also use a tell w block:

    tell w
        make new tab at end of tabs with properties {URL:the_url}
    end tell
    

    That way, tabs implicitly refers to tabs of w.

    Putting this all together, we get the following script. Given a list of URLs in the_urls, it will open all of them in a new window; if the_urls is empty, it opens a window with a blank tab.

    property the_urls : {¬
        "http://stackoverflow.com", ¬
        "http://tex.stackexchange.com", ¬
        "http://apple.stackexchange.com"}
    
    tell application "Safari"
        if the_urls = {} then
            -- If you don't want to open a new window for an empty list, replace the
            -- following line with just "return"
            set {first_url, rest_urls} to {"", {}}
        else
            -- `item 1 of ...` gets the first item of a list, `rest of ...` gets
            -- everything after the first item of a list.  We treat the two
            -- differently because the first item must be placed in a new window, but
            -- everything else must be placed in a new tab.
            set {first_url, rest_urls} to {item 1 of the_urls, rest of the_urls}
        end if
    
        make new document at end of documents with properties {URL:first_url}
        tell window 1
            repeat with the_url in rest_urls
                make new tab at end of tabs with properties {URL:the_url}
            end repeat
        end tell
    end tell
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying this simple GUI script to open a new window of Safari:
I am trying open a new window using url.Action. And the new Window url
i need to open a new browser tab on iPad safari using javaScript, i
I'm trying to force Safari or IE7 to open a new page using a
Using AppleScript, Can I open a URL in the CURRENT Safari window (i.e. without
I have window form in my WPF Application when I open new window from
I have some problem with my open new window popup which it can read
I tried to open a new window at the same position as another window.
I need to open a new window from code-behind on post-back if a specific
I cannot open a new window in QT. I new in QT so I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.