Jump to content

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


 Share

Recommended Posts

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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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.)

Link to comment
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!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...