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 6024209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:07:19+00:00 2026-05-23T04:07:19+00:00

While trying to make an automator action that opens multiple tabs from selected text

  • 0

While trying to make an automator action that opens multiple tabs from selected text as input I ran into an applescript issue I wasn’t able to solve for awhile. This includes the answer and I’m posting this here because I just wasn’t able to find documentation on how to handle data in “input” for a receives selected “text” in “any application” automator action, everything is for files which comes in as a list already.

When putting an applescript action in, you get:

on run {input, parameters}

the problem here is that input isn’t in a list format and trying to do anything with it breaks the script or throws an error. ie I can’t do:

        repeat with URL in input
        set this_URL to URL

So how can I treat a list of selected text as a list of items?

  • 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-05-23T04:07:20+00:00Added an answer on May 23, 2026 at 4:07 am

    the solution is first treat input as a string then break apart every paragraph.

    on run {input, parameters}
    
    set inputText to input as string
    set URL_list to every paragraph of inputText
    

    Without treating input “as string” first before doing “every paragraph of” it won’t work.

    Here’s the end working script, replace the “some_url” with your own. You’ll be able to select several lines of text in an editor and treat each one as a parameter to your fixed url opening each in a new safari tab. This could be expanded upon by having each line be delimited for multiple params on the url.

    on run {input, parameters}
    
    set inputText to input as string
    set URL_list to every paragraph of inputText
    tell application "Safari"
        activate
        repeat with URL in URL_list
            set this_URL to URL
            # extra processing of URL could be done here for multiple params
            my new_tab()
            set tab_URL to "http://some_url.com?data=" & this_URL
            set the URL of document 1 to tab_URL
        end repeat
    end tell
    return input
    end run
    
    on new_tab()
        tell application "Safari" to activate
        tell application "System Events"
            tell process "Safari"
                click menu item "New Tab" of ¬
                    menu "File" of menu bar 1
            end tell
        end tell
    end new_tab
    

    As an example say you had the list and had a service of the above using “http://stackoverflow.com/posts/” & this_URL

    6318162 
    6318163 
    6318164
    

    you could now select them click services and choose your “StackOverflow – view questions” service and it’ll append and open each one in a new safari tab. In my case I needed to verify multiple dns entries in our server as still valid and do a bunch of whois lookups.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've ran into a problem while trying to test following IRepository based on NHibernate:
While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal
While trying to connect to a database that's set to read only, the connection
While trying to integrate Yahoo Media Player into my own website, I want to
Got stuck while trying to make an element in website behave like this: <div
While trying to answer a question in the vicinity ' Unit Testing WPF Bindings
While trying to use LINQ to SQL I encountered several problems. I have table
I'm getting an Exception while trying to insert a row in oracle table. I'm
I got an error today while trying to do some formatting to existing code.
I'm trying to test the DB2 adapter for BizTalk 2006 (not R2). While trying

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.