- AuthorPosts
- January 12, 2013 at 11:10 pm #10755user Participanthello! is it possible to select multiple links and open all of them in default web browser with one click? thanks! January 13, 2013 at 5:44 pm #10759Yutaka Emura KeymasterNo, but you should be able to write a macro to do this. Thanks! January 14, 2013 at 1:36 am #10762user Participantwould be easy for you to write one? thanks! April 10, 2013 at 10:22 am #10929user Participantanyone please???? April 10, 2013 at 2:13 pm #10932Stefan Participantuser wrote: 
 is it possible to select multiple links and open all of them in default web browser with one click?You can not do more then one selection at once. 
 But you can use a script/macro to extract and collect all URLs
 and then use something like (For Each URL in URLs Do “open browser”)April 10, 2013 at 4:57 pm #10935Stefan Participant
 
 I have searched for an good regex to match url.
 An basic for an script could be://Text to parse for URL: 
 selText = document.selection.text;
 //
 //
 //Show matched URLs:
 vURLs = findUrls(selText);
 alert(vURLs);
 //
 //
 //Open matched URLs:
 vURLs = findUrls(selText);
 openUrls();
 function findUrls(searchText){
 // gruber revised expression - http://rodneyrehm.de/t/url-regex.html
 var regex= /b((?:[a-z][w-]+:(?:/{1,3}|[a-z0-9\%])|wwwd{0,3}[.]|[a-z0-9.-]+[.][a-z]{2,4}/)(?:[^s()<>]+|(([^s()<>]+|(([^s()<>]+)))*))+(?:(([^s()<>]+|(([^s()<>]+)))*)|[^s`!()[]{};:'".,<>?«»“”‘’]))/ig;
 result= searchText.match(regex);
 if(result){return result.join("rn");}else{return false;}
 }
 function openUrls(vURLS){
 var ie = new ActiveXObject("InternetExplorer.Application");
 ie.Visible = true;
 arr = vURLs.split("rn");
 for(i=0,E=arr.length; i<E; i++){
 vURL = arr[i];
 ie.Navigate(vURL);
 pause(1000);
 
 if(i==3) quit(); // for debugging only
 }
 }
 function pause(ms) {
 ms += new Date().getTime();
 while (new Date() < ms){}
 }This will open every url in IE but in same tab. Use History back. You may want to find a solution to open each url in a new tab. You can utilize other browsers maybe by using a code like: 
 var wsh = new ActiveXObject(“WScript.Shell”);
 wsh.run(“notepad.exe”, 1, True);April 10, 2013 at 5:07 pm #10936user Participantwow, thanks! 
- AuthorPosts
- You must be logged in to reply to this topic.