10 Replies Latest reply: Sep 8, 2013 6:25 PM by Hamper
Hamper Level 1 Level 1 (0 points)

Is there a Safari extension that allows me to paste multiple URLs into Safari so it opens them in separate tabs?

 

I know Safari is quite restrictive, but is there a way to get this made even, does the Safari API allow for this kind of thing?

  • 1. Re: Paste URLs into new tabs
    Carolyn Samit Level 10 Level 10 (89,655 points)

    Not an extension or plugin I'm aware of.

  • 2. Re: Paste URLs into new tabs
    Hamper Level 1 Level 1 (0 points)

    Yea, it's been this way for ages, too long, Chrome just runs away with this kind of stuff (especially when the Google Devs do it themselves and maintain their efforts).

     

    I would like to get one made, but can it be done, does the API allow for it or is there a reason why one does not exist?

  • 3. Re: Paste URLs into new tabs
    Niel Level 10 Level 10 (242,055 points)

    Open the AppleScript Editor in the /Applications/Utilities/ folder and run a script such as:

     

    set the_URLs to "

    http://www.apple.com/?a=01

    http://www.apple.com/?a=02"

    set the_strings to paragraphs 2 thru -1 of the_URLs

    tell application "Safari"

    repeat with this_string in the_strings

    open location this_string

    end repeat

    end tell

     

    To do this with the clipboard contents:

     

    set the_URLs to the clipboard

    set the_strings to paragraphs of the_URLs

    tell application "Safari"

    repeat with this_string in the_strings

    open location this_string

    end repeat

    end tell

     

    (88644)

  • 4. Re: Paste URLs into new tabs
    Carolyn Samit Level 10 Level 10 (89,655 points)

    Ooops.. looks Niel came to your rescue 

  • 5. Re: Paste URLs into new tabs
    Hamper Level 1 Level 1 (0 points)

    What I normally do is have a list of URLs in Text Edit an just c&p them into Chrome and they populate into new tabs, this one looks like I have to set it up with certain URLs in mind?

     

    If you can do this Niel, then why not release an extension, I can't be the only one who has needed this since v4?

  • 6. Re: Paste URLs into new tabs
    Niel Level 10 Level 10 (242,055 points)

    1. You don't; the source is adjustable. The following code will retrieve the content of the frontmost TextEdit document:

     

    tell application "TextEdit"

    set the_URLs to text of document 1

    end tell

     

    2. I don't write Safari extensions.

     

    (88645)

  • 7. Re: Paste URLs into new tabs
    Hamper Level 1 Level 1 (0 points)

    So, if I want to simply paste a block list of URLs from a text file into new tabs in Safari I need, which would be from the clipboard then as I copied them from the text file:

     

    set the_URLs to the clipboard

    set the_strings to paragraphs of the_URLs

    tell application "Safari"

    repeat with this_string in the_strings

    open location this_string

    end repeat

    end tell

     

     

    That in a script, I double click it and it works?

  • 8. Re: Paste URLs into new tabs
    Niel Level 10 Level 10 (242,055 points)

    Yes. Save the script as an application.

     

    (88648)

  • 9. Re: Paste URLs into new tabs
    Hamper Level 1 Level 1 (0 points)

    I still don't get why someone hasn't made this as an extension?!

  • 10. Re: Paste URLs into new tabs
    Hamper Level 1 Level 1 (0 points)

    Hey, it works, thanks very much.

     

    Would you be able to give me the code for copying all tabs and I'll hire someone to make a nice extension (which is well overdue!).

     

    Thanks!