Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to automatically open multiple links simultaneously

Status
Not open for further replies.

amarkmac

IS-IT--Management
Aug 3, 2006
13
US
I know this is a little long, but it's an interesting problem (I think), so please bear with me.

Statement of Problem/Facts:
1) I am tasked with creating a stand-alone program to assist folks identify reference material.
2) The user will select the references needed and the program will store "batches" of them for the user.
3) The user will then use their stored batches to access the reference material through a browser. (So, obviously, the batch is really just a collection of weblinks.)
4) Here's the kicker 1. Ideally, when the user wants access to these links, they want them to all open at once--ideally in tabs, although several windows would be workable.
5) Here's kicker 2. Ideally, the program should launch the browser for them.
6) Note that these users constitute a limited pool folks who will know in advance how this system is supposed to work--it's not targeting the general unsuspecting public (i.e., no pop-up floods).
7) The project is currently limited to the WIndows platform, but could still involve multiple browsers.

Progress/Problems to date:
1) A prototype of the program has been developed. It successfully generates and maintains the list of links (Yes, I know, this was the easy part).
2) For IE7, the prototype can generate a temp file containing JScript/VBScript that will successfully launch IE and open each link in a background tab--limited success for kicker 1. (See sample code.)
Code:
var navOpenInBackgroundTab = 0x1000;
var oIE = new ActiveXObject("InternetExplorer.Application");

oIE.Navigate2("[URL unfurl="true"]http://www.site1.com");[/URL]
oIE.Navigate2("[URL unfurl="true"]http://www.site2.com",[/URL] navOpenInBackgroundTab);
oIE.Navigate2("[URL unfurl="true"]http://www.site3.com",[/URL] navOpenInBackgroundTab);

oIE.Visible = true;
3) Unfortunately, I can't get the prototype to execute the .js file, so the program can't open the browser tabs for the user--failed to accomplish kicker 2.
4) Failure 3--js won't work with other browsers, as far as I know. So, this isn't the best solution anyway.
5) It may be that we need to have the user indicate to the program which browser they are using so that we can implement several different strategies. But it would be better to find one scripting solution that would support the majority of browsers--or at least the most popular. If we implement different strategies, then I still need to be able to execute .js files from within a program (need another forum?), or come up with a better scripting solution that accomplish both kickers.


Comments:
I was originally hoping that this could be accomplished using HTML (or variants) for ease in supporting various browsers. But, after discussions on several forums, it was suggested that JavaScript might be the way to go. It would be nice if only one solution was devised, so I'm hoping that javascript will come to the rescue. (We can always advise users in advance of the browser settings and other requirements needed, if we have to.)

I've poked around several scripting forums looking for a way to automatically open multiple links, say in a loop that might execute onOpen, but didn't find anything. Maybe it can't be done (don't believe that) or maybe I just didn't look in the right places.

Seeking ya'lls expert advise. I'm a bit script-ignorant.

Thanks, Mark.
 
Get your users to use a browser (like Safari - available for free on MacOSX and Windows). They can use the built-in bookmarking feature to save bookmarks of their research (allowing them to rename the bookmarks as needed). Each "group" of bookmarks lives in a folder. You can use the built-in "Open in tabs" option to open all bookmarks contained in a folder in one go.

I would suggest that the fit is so close to the requirements (and the effort is merely some user education) that it is worth considering as an alternative.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Firefox also does this.

--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top