EmEditor (text editor) Forum Index
   Questions and Answers about EmEditor Core
     open multiple links
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
user
Posted on: 1/12/2013 2:10 pm
Home away from home
Joined: 9/29/2006
From:
Posts: 212
open multiple links
hello!

is it possible to select multiple links and open all of them in default web browser with one click?

thanks!
Yutaka
Posted on: 1/13/2013 8:44 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2399
Re: open multiple links
No, but you should be able to write a macro to do this.

Thanks!


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

user
Posted on: 1/13/2013 4:36 pm
Home away from home
Joined: 9/29/2006
From:
Posts: 212
Re: open multiple links
would be easy for you to write one?

thanks!
user
Posted on: 4/10/2013 2:22 am
Home away from home
Joined: 9/29/2006
From:
Posts: 212
Re: open multiple links
anyone please????
Stefan
Posted on: 4/10/2013 6:13 am
Home away from home
Joined: 7/14/2008
From: Germany, EU
Posts: 263
Re: open multiple links
Quote:

user 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")


 
Stefan
Posted on: 4/10/2013 8:57 am
Home away from home
Joined: 7/14/2008
From: Germany, EU
Posts: 263
Macro: extract URLs open with INternet Explorer
 
 
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%])|www\d{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("\r\n");}else{return false;}
}
function openUrls(vURLS){
	var ie = new ActiveXObject("InternetExplorer.Application");
	ie.Visible = true;
	arr = vURLs.split("\r\n");
	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);


 
user
Posted on: 4/10/2013 9:07 am
Home away from home
Joined: 9/29/2006
From:
Posts: 212
Re: Macro: extract URLs open with INternet Explorer
wow, thanks!
Threaded | Newest First Previous Topic | Next Topic | Top


Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文