Applescript/Automator - Open all links on a webpage

I am stuck trying to build an Applescript or Automator Workflow that goes to a predefined web page, and then loads each of the links found on the web page.  The catch is that I want to loop through one at a time (with a delay between each one). 
I've been able to get all the urls to load simultaneously via Automator, but can't figure out how to loop through the urls with a delay.
Thank you in advance for any tips.

I figured out how to accomplish this by having applescript fire some javascript code inside safari (I read about it here:
--http://stackoverflow.com/questions/5135609/can-applescript-access-browser-tabs-a nd-execute-javascript-in-them)
.  Here's what my applescript looks like now:
on run {input, parameters}
          tell application "Safari"
  activate
                    repeat with i from 1 to length of input
                              make new document at the front of documents
                              set the URL of the front document to item i of input
                              delay 10
                              do JavaScript "var links = document.getElementsByTagName('a');
var match = 'http://www.google.com';
for(var i=0; i<links.length; i++) {
  var href = links[i].getAttribute('href');
  if(href.indexOf(match) != -1) {
    document.location.href = href;
    break;
}" in the front document
delay 10
                               close every window
                    end repeat
          end tell
  -- return input
end run

Similar Messages

  • Automator: load webpage fully and open all links?

    Hi,
    In addition to this script: Applescript/Automator - Open all links on a webpage I'm able to open all links on a website, but I'm trying to open all links on a fancy website that keeps loading if I keep scrolling to the bottom and/or click on show more posts. I've tried loading my website fully, but automator only detects the "first page" of it. Don't know if that makes sense.
    Tried to save it as a web archive from Safari, but that doesn't do the trick, I just get an error and it doesn't detect any links... unless I'm doing something wrong. 
    Current workflow:
    Get Current Webpage from Safari
    Extract URLs from Text
    Get Link URLS from Webpages
    Filter URLs
    Run AppleScript

    You can use the SearchReset extension to reset some preferences to the default values.
    *https://addons.mozilla.org/firefox/addon/searchreset/
    Note that the SearchReset extension only runs once and then uninstalls automatically, so it won't show on the "Firefox > Add-ons" page (about:addons).
    If you do not keep changes after a restart or otherwise have problems with preferences, see:
    *http://kb.mozillazine.org/Preferences_not_saved

  • How to print all links in a webpage. IE has had this for over 10 yrs.

    This has been an option in IE since day 1, but I do not see any way to have Firefox print all links in a web page.

    Firefox Has an add-on called Download them all which will enable you to print all links in a webpage. Here is the link to the add-on:
    https://addons.mozilla.org/en-US/firefox/addon/downthemall/
    I hope this will help :)

  • Firefox opens all links in the current tab.

    firefox used to open links from google in the same tab while having links like gyazo links or anything like that open in a new tab. similar to how google chrome does it. then i reset firefox and now when i try to open links it opens them in the current tab. i know that i can right click and open in a new tab but it gets annoying doing that over and over again. is there anyway i can put it back how it was?

    Most likely not. As far as I know, the decision to open in a new or current tab by default comes from the webpage, not the browser. However, there's an easy way to do this.
    1. Try clicking the middle mouse button (the wheel). This is a built-in shortcut in Firefox to open the link in a new tab.
    2. You could try an extension. https://addons.mozilla.org/en-US/firefox/addon/open-link-in-new-tab/
    Other than that, I don't know.

  • Open all links and bookmarks in a new tab

    Today I updated to FF 23.0 and Tab Mix Plus is no longer fully functional, and I had to disable it. I am trying to duplicate its functions in about:config.
    I have two issues:
    1. How can I get all bookmarks to open in a new tab on the far right? Bookmarks are opening on top of the active tab, and this I cannot abide.
    2. How can I get all links to open in a new tab? No new windows, no right-click, no over-writing the current tab... just make ALL links open in a new tab on the far right?
    Thank you.

    You can use the SearchReset extension to reset some preferences to the default values.
    *https://addons.mozilla.org/firefox/addon/searchreset/
    Note that the SearchReset extension only runs once and then uninstalls automatically, so it won't show on the "Firefox > Add-ons" page (about:addons).
    If you do not keep changes after a restart or otherwise have problems with preferences, see:
    *http://kb.mozillazine.org/Preferences_not_saved

  • Firefox opens all links in a new window

    I am using Firefox 4.0.1. I have checked the settings on my browser under Tools / Options / Tabs and "open new windows in tabs" is set. However, whenever I click on a link on a website, Firefox opens the link in a new window. This occurs even if I right click on the link and choose the option to open the link in a new tab instead of a new window.
    This behavior began just recently. To the best of my knowledge, none of the add-ons have updated recently.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Script: Open all linked docs in *new* window

    Can anybody help? I have a pdf document that will need to have 2000+ links to other documents...and I need to have each link open in a *new* window (by default, they open in the exisitng window). We obviously don't want to have to individually set each link's Properties to "open in new window"...
    Is there a script I can add to the main (parent) pdf doc to make this happen for all links the user clicks on from the main doc? The kicker is that we can't expect the end user to be able to fool with the Preferences or anything like that...in addition, we assume the user may be viewing in either Acrobat or Acrobat Reader in the corporate environment.
    Alternately, a script to automatically show the "previous view" and "next view" arrows, without having the user have to do anything, might work. The absence of those arrows in the default view (starting w Acro 8?) is why we've had to go with the "open in new window" idea. We are dealing with non-tech-savvy users, so we don't want them to have to know keyboard shortcuts or set Preferences...
    Thanks so much!!!
    Bradford

    Absolutely, thanks! I will try to create a variable to store -- and later, restore -- that. Since we have about a zillion links, changing each link would be no fun at all! Is there an issue with trying to evaluate the setting and store the variable from a "on page 1 open" action, and being able to access the variable's value from the "DocumentWillClose" action? (and apologies for any capitalization, etc., issues)
    Do I somehow need to declare the variable to be global, or do I need to have the initial actions happen from an "on document open" event? (I don't see such an event as being an available option)...
    Any code snippet(s) far a similar situation that you could point me towards...?
    Thanks!
    Bradford

  • Using Applescript to open a link in an email and printing out the result

    This may have been answered before but I can't find it. Does anyone have a script that can read an email to find a link contained within it, open said link and then print it?

    Tried that. Unfortunately it did not work.

  • How stop FF31 from opening new window? I want to open all links in new tab at top of page.

    I think the following, quote below, from the help page is my problem.
    I have this one website I use that when I click on a link within the website it is opening a new window with the tab at the bottom. Also, when this happens, I am losing the orange FireFox rectangle, bookmarks and navigation options. How can I set FF31 so that the link opens in a new tab and I keep all my options? I am using Classic Theme Restorer 1.2.3. I also notice that in the new window I lose the ability to use some of the addons.
    I have two laptops and both are running FF31 and W7. One of them is working perfectly and the other is having this problem. As far as I can tell they are both set up the same. The only difference is that when I upgraded to FF31 they both had difference older versions of FireFox. I also read in the help forum that maybe I need to go back to FireFox 28 to accomplish what I am trying to accomplish.
    I noticed that when I go under about:config that the version of FF that is not working has fewer available options versus the version that is working. An example would be that the working version has "browser.tabs.onTop" where on the other laptop this is missing.
    >>>Open new windows in a new tab instead: This option controls whether links from other applications or from web pages which request to open them in new windows are opened in a new window or a new tab in the most recent window.
    Note: If you have chosen to open pages in new tabs, Firefox will ignore this option and will open a new window from a link if the page author specified that the new window should have a specific size, because some pages can only be displayed correctly at a specific size.<<<
    Thank you in advance for any help,
    yeto

    You can override how links are opened via the browser.link.open_newwindow.override pref.
    *http://kb.mozillazine.org/browser.link.open_newwindow
    *1: current tab; 2:new window; 3:new tab;
    Use this for links opened via JavaScript.
    *http://kb.mozillazine.org/browser.link.open_newwindow.restriction
    See also:
    *http://kb.mozillazine.org/Prevent_websites_from_disabling_new_window_features

  • Force Safari to open ALL links and everything else in tabs

    I want to have just one Safari window open and all the links that I click on that are supposed to be in a new window open in a new tab and all the links that I click on any other program open on the same safari window but in a new tab just like in Firefox.
    Can I do that? One single window for all my browser needs?

    Hi
    Sure you can do it - you enter the following in Terminal
    +defaults write com.apple.Safari TargetedClicksCreateTabs -bool true+
    then press the Return key
    read more about it here or see google

  • Is there a way to get Firefox to open a link on a webpage by hovering over it

    I often browse websites and find that I often spend time clicking on links to open and go to them
    Is there a way to configure Firefox to open by hovering over the link?

    I want it to open without having to click on the icon. I would like it to open by itself when the computer is turned on.

  • How to open "All Tabs" from previously shown pages history?

    Hi,
    How to open "All Tabs" from previously shown pages history. I am not asking about "Reopen from last session". I am asking about how to open all tabs from previous webpage links from a past date from history, currently its allowing me to select each page link manually by clicking it.
    Thank you!

    Select the first item you wish to open, scroll down to the last, Shift-click that one & all those between should be selected too. Double-click on them & they should all start to open... or you can copy & then drag/paste into a new or existing bookmarks folder.

  • 2 Problems - Can't open a PDF inside IE 8, can't open a link in a PDF

    I am running Vista Business on a Lenovo ThinkCentre with dual core Intel processor, 2 GB RAM. I have 2 problems with Reader 9.3.0.
    First it will not open a PDF inside IE 8. Instead it opens the PDF in a new Reader window. It does open a PDF inside Firefox. In Edit|Preferences|Internet the Display PDF in browser checkbox is checked. In IE 8 Tools|Manage Add-ons|Run without permission Adobe PDF Reader is Enabled.
    The second problem is that I cannot open a link in a PDF file. When I place the cursor over an e-mail or internet link in a PDF file the little hand appears. However when I click on the link nothing at all happens.
    Does anyone have any suggestions on how to fix either of these problems?
    Ira B.

    In the replies I have been receiving, nobody has said which problem of the
    two I wrote about they are experiencing. I assume that all are using Vista
    (I use Vista business) since neither of these problems appear on my machine
    that runs XP Pro.
    I have managed to get around these problems and am happy to share my
    experiences with all, but I advise not getting too excited since my solution
    may not be exactly what others might want. Of the two problems, the one
    where I was unable to open an e-mail or web link in Acrobat Reader was the
    more serious for me. I edit a couple of newsletters that almost always
    contain some of these links and I need to be able to test them to make sure
    they are correct before I send out a newsletter.
    I found out that if I used Foxit Reader in place of Acrobat Reader I was
    able to open all links with no problems. For a while I had both readers
    installed with both able to open PDFs in IE8 but only Foxit able to open
    links in a PDF file. Then Foxit Reader began to exhibit the problem of PDFs
    not opening in an IE8 browser window. Then the problem spread to Acrobat
    reader. I have no idea as to the cause.
    I tried removing and re-installing both Readers but was unable to rid myself
    of the problem. I then contacted Foxit support for some assistance. Yes,
    unlike Adobe, they actually try to help if you are having a problem with
    Foxit Reader. Foxit support gave me a procedure to try but it did not work
    at first. I finally found out that I had to install Foxit Reader with User
    Access Control (UAC) shut off in Vista. If UAC was not shut off, Foxit's
    addin for IE8 would not install properly. Then I re-enabled UAC and followed
    the procedure Foxit support suggested which is:
    1. Login your machine with admin account, right click on > FoxitReader.exe
    2. Select "Properties"
    3. Select "Compatibility" tab
    4. Uncheck "Run this program as an administrator" under "Privilege Level"
    5. Select "Show settings for all users"
    6. Click on "Continue" if there is a prompt.
    7. Uncheck "Run this program as an administrator" under "Privilege Level".
    (This was already unchecked in my case.)
    After this Foxit Reader opened PDF files in browser windows in both IE8 and
    Firefox.
    I think that this procedure might work for Acrobat Reader; at least I think
    it might be worth a try. I don't want to try it myself because my computer
    is working just fine right now with Foxit Reader and I don't want to take
    the chance of screwing it up since it was so difficult for me to get to this
    point.
    If someone would like to try it, I suggest removing Acrobat Reader, then
    disabling UAC and re-installing Acrobat Reader. Then enable UAC again. Then
    follow the 7 steps above for AcroRd32.exe. I am hopeful, but by no means
    certain, that then PDF files will open in an IE8 browser window. I would
    appreciate it that, if anyone tries this, they would let me know their
    results. I regret not being able to provide a more definitive solution.
    irablum1

  • Is there an "insert all links" type of feature or add-on for Firefox that works with Thunderbird?

    Hello Firefoxies,
    Is there an "insert all links" type of feature or add-on for Firefox that works with Thunderbird or any email app? I want to be able to insert all the links from a Firefox bookmarks folder automatically in to an outgoing email and include the names that I have given to those saved links / bookmarks.
    I searched for this add-on on the Firefox and the Thunderbird sites, but I don’t think the one that I found is for what I am thinking of.
    What I would like to do is to be able to add all the links in a saved tabs folder, or any bookmarks folder, from Firefox in to the body of an outgoing email preferably in Thunderbird, or any email app... so I could just click and all the links and hopefully all the names that I have given to those links will then appear in the body of an outgoing email automatically, ready for me to then write what I want, plug in an address, and send.
    When I did a search of add-ons on the Firefox and Thunderbird sites, I found something called “Open all links 0.3.1” on the Thunderbird site that I think is for the opposite of my description... I think this add-on is to automatically open all the links in an email that is received... '''which IS NOT what I want to do'''... I want to place all the links that I have in a Firefox bookmarks folder in to an outgoing email... the URL to the “Open all links 0.3.1” add-on is below for you to look at just in case I am reading this wrong...
    https://addons.mozilla.org/en-US/thunderbird/addon/2913/
    Otherwise, I could not find any add-on that fits my description.
    Thanks so much,
    numetro

    Hello Firefoxies,
    Is there an "insert all links" type of feature or add-on for Firefox that works with Thunderbird or any email app? I want to be able to insert all the links from a Firefox bookmarks folder automatically in to an outgoing email and include the names that I have given to those saved links / bookmarks.
    I searched for this add-on on the Firefox and the Thunderbird sites, but I don’t think the one that I found is for what I am thinking of.
    What I would like to do is to be able to add all the links in a saved tabs folder, or any bookmarks folder, from Firefox in to the body of an outgoing email preferably in Thunderbird, or any email app... so I could just click and all the links and hopefully all the names that I have given to those links will then appear in the body of an outgoing email automatically, ready for me to then write what I want, plug in an address, and send.
    When I did a search of add-ons on the Firefox and Thunderbird sites, I found something called “Open all links 0.3.1” on the Thunderbird site that I think is for the opposite of my description... I think this add-on is to automatically open all the links in an email that is received... '''which IS NOT what I want to do'''... I want to place all the links that I have in a Firefox bookmarks folder in to an outgoing email... the URL to the “Open all links 0.3.1” add-on is below for you to look at just in case I am reading this wrong...
    https://addons.mozilla.org/en-US/thunderbird/addon/2913/
    Otherwise, I could not find any add-on that fits my description.
    Thanks so much,
    numetro

  • Director automatically open all the links of  webpage in the new window

    hi
    i want to design the application in director .when user enter
    the URL of any website then all links of web page open in the new
    window....
    for example ..if user type "
    www.Google.com" then all links(hypertext) of Google webpage
    automatically open in the new /separate window ...
    reply me how can i do this
    regards farhana

    Just off the top of my head you could use getNetText(URL) and
    netTextResult(netID) to get the HTML source of the web page as a
    string, parse the string for <a> tags, extract the href
    attribute to create a list of links, then use gotoNetPage using
    _new as a target to spawn a bunch of browser windows with those
    links. IMHO the result would be like getting spammed with dozens if
    not hundreds of popups but there is no reason why it wouldn’t
    work.

Maybe you are looking for

  • Background Job Scheduling

    Hi,   I am scheduling a report to run in background. In this report it is creating background jobs automatically for different company codes. It submits the 1st background job and waits until it finishes. Then 2nd job starts in background and continu

  • Entourage Freezes when I try to email an attachment

    After installing SL yesterday I have noticed that every time i try to email an attachment in Entourage I have to do a force quit as it freezes. I can email from Word ie. send attachment via email when I am in word, but can not create an email in Ento

  • UCCX 8.0.2 Installation error?

    Hello All, I'm trying to install UCCX 8.0.2  Installation on VMware Infrastrcture in the Lab environment. Enclosed file is the screen shot of Installation error, I appreciate if you can advise me why I'm facing this installation error?

  • Monitoring customer's systems in Solution Manager 7.1

    Hello gurus. I have successfully added our internal system to our Solution Manager 7.1 SP4 running on Oracle 11.2.0.2. And now I'm wondering is it possible to add customer's systems to our Solution manager? There are some unclear moments one of which

  • Fractions in To/From lines

    Suddenly the To, From, Date, and Subject lines are appearing in Helvetica Fractions. Very weird! I can't seem to find how to get these to display correctly. Mac Mini   Mac OS X (10.4.9)