Apple’s Worldwide Developers Conference to kick off June 10 at 10 a.m. PDT with Keynote address

The Keynote will be available to stream on apple.com, the Apple Developer app, the Apple TV app, and the Apple YouTube channel. On-demand playback will be available after the conclusion of the stream.

Developer Forums relocated!

Need help with Apple Developer tools and technologies? Want to share information with other developers and Apple engineers? Visit Developer Forums at Apple.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Apple Automator to view a list of URLs from a text file

Hello,

I am new to automator and need help with something probably very easy. I run into scenarios where I want to compile a list of URLs in a text file. Then I want to use Apple Automator to view each one of those URLs in a separate tab in a browser. I would prefer to view the page, then have to hit enter or something to go to the next one rather than having all of the URLs open in separate tabs at the same time. My MAC is OSX 10.9.4, Automator V2.4. I can use


Get Specified URLs > Display Web Pages


but I have to cut and paste the URLs into Get Specified URLs. I want to read the URLs from a text file. I saw some posts that say to use "Get Specified Finder Items" > "Combine Text Files" > "Filter Paragraphs" but this does not work either. The flow I am trying is


Get Specified Finder Items > Combine Text Files > Filter Paragraphs > Get Specified URLs > Display Web Pages


When I run this work flow I see Filter Paragraphs outputs the list of URLs but with parens around them

(

http://www.abc.com/response.write(9367528*9847690)/misc/hpg.cfm

http://www.abc.com/' response.write(9367528*9847690) '/misc/hpg.cfm

http://www.abc.com/" response.write(9367528*9847690) "/misc/hpg.cfm

http://www.abc.com/set|set&set/misc/hpg.cfm

)

I see the output of Get Specified URLs is empty which causes the error "The action Display Webpages was not supplied the required data".


Any help is appreciated

Joe

OS X Mavericks (10.9.4), Automator

Posted on Aug 11, 2014 1:02 PM

Reply
Question marked as Best reply

Posted on Aug 18, 2014 9:19 AM

I have made a bit of progress with this. The following workflow will display all URLs in the text file in a separate browser tab, but all at the same time.


Get Specified Finder Items > Combine Text Files > Extract URLs from Text > Get Specified URLs > Display Web Pages


It kills my browser when I have 50+ URLs in the input text file. I would really like it to open 1 URL, wait for me to kill that tab or something similar, then display the next URL.


Joe

7 replies
Question marked as Best reply

Aug 18, 2014 9:19 AM in response to joled0

I have made a bit of progress with this. The following workflow will display all URLs in the text file in a separate browser tab, but all at the same time.


Get Specified Finder Items > Combine Text Files > Extract URLs from Text > Get Specified URLs > Display Web Pages


It kills my browser when I have 50+ URLs in the input text file. I would really like it to open 1 URL, wait for me to kill that tab or something similar, then display the next URL.


Joe

Aug 18, 2014 12:27 PM in response to joled0

Hi,


Try this, it open a url in new tab on Safari, and wait until this tab is closed


In Automator:

1- Get Specified Finder Items -- one text file

2- Add "Run Applescipt script" action

Remove all text in the action

Put this script into the action


on run {input, parameters}
     read (item 1 of input)
     set ps to paragraphs of the result
     set tot to count ps
     tell application "Safari"
          reopen
          activate
     end tell
     repeat with i from 1 to tot
          set p to item i of ps
          if p is not "" then
               try
                    tell application "Safari"
                         tell front window
                              set r to make new tab with properties {URL:p}
                              set current tab to r
                              delay 1
                              if i = tot then exit repeat
                              repeat
                                   delay 1
                                   get URL of r
                              end repeat
                         end tell
                    end tell
               end try
          end if
     end repeat
end run


Remove all others actions

Apple Automator to view a list of URLs from a text file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.