Sign in to follow this  
Followers 0
CheeseFries

How to open up 5 websites in 5 different tabs simultaneously in both IE and Firefox?

5 posts in this topic

Hi all,

I am trying to open up 5 websites in 5 different tabs simultaneously in both IE and Firefox.

The current script I have done is very unstable because any button press or click on the mouse will cause the script to go haywire.

I have store the list of websites to be open up in a folder for Firefox and IE.

In order to open up the website, I have to navigate through the browser by sending keystroke, is there any other way to do this?

Script for IE

run("C:\Program Files\Internet Explorer\iexplore.exe") ;Run Internet Explorer
Sleep(5000) ;Pause the script for 5 sec until IE is active
$title = WinGetTitle("[active]") ;Get the title of IE
ControlClick($title, "", 1) ;Click on Favorites
Sleep(3000) ;Pause the script for 3 sec
Send("{DOWN 2}") ;Move down 2 times
Send("{APPSKEY}") ;Press Windows Application key to open up a menu (This menu is displayed by right clicking)
Sleep(1000) ;Pause the script for 1 sec
Send("g") ;Send the letter 'g' to open all website in the folder
Sleep(30000) ;Pause the script for 30 secs
$title1 = WinGetTitle("[active]") ;Get the title of IE
WinClose($title1, "") ;Close the IE
Send("!t") ;Send Alt+t to close all tab
Sleep(5000) ;Pause the script for 5 secs

Script for Firefox

run("C:\Program Files\Mozilla Firefox\firefox.exe") ;Run Mozilla Firefox
Sleep(5000) ;Pause the script for 5 secs until Firefox is active
Send("!b") ;Send Alt+b to open up Bookmark Menu Bar
;Send("{END}") ;If the bookmark is at the last of the menu bar, this line will be useful but remember to comment out line 7
Send("{DOWN 7}") ;Move down 7 times
Send("{RIGHT}") ;Move right to expand a submenu
Send("{END}") ;Move to the last button of the menu
Send("{ENTER}") ;Hit Enter
Sleep(30000) ;Pause the script for 30 secs
$title = WinGetTitle("[active]") ;Get the title of the Firefox
WinClose($title, "") ;Close the Firefox
Sleep(2000) ;Pause the script for 2 secs
Send("!q") ;Send Alt+Q to quit

Thanks in advance !!!

- Johnny

Share this post


Link to post
Share on other sites



There are UDFs (User Defined Functions) available that should make your life a bit easier. The UDF for the IE is part of AutoIt, the FF UDF can be downloaded from the example scripts forum.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

An example for internet explorer:

#include <IE.au3>
DIM $ie = _IECreate()
_IENavigate($ie, "http://www.autoitscript.com", 0)
__IENavigate($ie, "http://www.google.com", 0, 0x800)
__IENavigate($ie, "http://www.microsoft.com", 0, 0x800)

(Note: the double underscore is not a typo.)

Share this post


Link to post
Share on other sites

You could just use a simple

_RunDos(start http://google.com & start http://youtube.com/ & start http://autoitscript.com/ & start http://akarillonitsolutions.blogspot.com/)

This just opens in default browser, but you can set the default browser in the registry to whatever browser you want and then run the script again to get the same sites in 2 browsers.


Challenge accepted!

Share this post


Link to post
Share on other sites

Thanks everyone for your replies :graduated: I will take a look at the solution you guys give.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0