Automatically open multiple tabs in Firefox browser from DOS command line with URL in incremental sequence numbering (Rev: 1.2)



To easily read online comics, I use the Firefox browser add-on, AutoPager that will automatically loads the next comic page of a site inline when you reach the end of the current comic page for infinite scrolling of the comic content. However, AutoPager did not work on some of the comics sites. Hence, I have created a .bat file,
0_openMultipleTabsInFirefox_fromCommandLine.bat
(1157 bytes. MD5 checksum: 9ebefed48915a157d23dcab3a60420df)

to automatically open multiple tabs in Firefox browser from DOS command line with URL in incremental sequence numbering.

For example, if a comic website, www.abc.com has a comic with title xxx with
page 2 URL as http://www.abc.com/comic/xxx/01/?2,
page 3 URL as http://www.abc.com/comic/xxx/01/?3, and so on until
page 34 URL as http://www.abc.com/comic/xxx/01/?34

By opening a command prompt in Windows XP SP3 x86 Operating System (OS), and enter the below command:

0_openMultipleTabsInFirefox_fromCommandLine.bat http://www.abc.com/comic/xxx/01/?


The Firefox browser will automatically open multiple tabs with URL in incremental sequence numbering from http://www.abc.com/comic/xxx/01/?2 to http://www.abc.com/comic/xxx/01/?34. After finish reading a comic page, I will use Firefox browser keyboard shortcut, [CTRL] w to close that page tab.


----- Start 0_openMultipleTabsInFirefox_fromCommandLine.bat --------------------

@echo off
rem Automatically open multiple tabs in Firefox browser from DOS command line
rem with URL in incremental sequence numbering
rem For reading online comics that has URL page number in incremental sequence numbering
rem Command usage is as shown below:
rem %BATFILE% URL
rem JackNg, Rev: 1.1

SET BATFILE=0_openMultipleTabsInFirefox_fromCommandLine.bat

rem For Windows x86 OS only
SET FFOX="C:\Program Files\Mozilla Firefox\firefox.exe"
rem For Windows x64 OS only
rem SET FFOX="C:\Program Files (x86)\Mozilla Firefox\firefox.exe"

SET STARTPAGE=2
SET STEPAMOUNT=1
SET ENDPAGE=34

IF "%1" == "" GOTO NOURL

rem /L = Logic. Numbers increment start from 2 to 34 with step amount of 1
FOR /L %%i IN (%STARTPAGE%,%STEPAMOUNT%,%ENDPAGE%) DO %FFOX% -new-tab "%1"%%i
GOTO EXIT


:NOURL
echo No URL specified in the command line.
echo Command usage is as shown below:
echo ------------------------------------
echo %BATFILE% URL
echo ------------------------------------
echo Exiting...
echo.


:EXIT
set BATFILE=
set FFOX=
SET STARTPAGE=
SET INCREMENT=
SET ENDPAGE=

----- End 0_openMultipleTabsInFirefox_fromCommandLine.bat --------------------


Reference:

[1] Open multiple tabs in Firefox from a file containing urls

1 comment:

Jack Ng said...

To use Google Chrome browser, I create a file calls "c_openMultipleTabsInChrome_fromCommandLine.bat", with the below changes only:

rem Automatically open multiple tabs in Chrome browser from DOS command line
rem with URL in incremental sequence numbering

SET BATFILE=c_openMultipleTabsInChrome_fromCommandLine.bat

rem For Windows x64 OS only
SET GCHROME="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

FOR /L %%i IN (%STARTPAGE%,%STEPAMOUNT%,%ENDPAGE%) DO %GCHROME% --newtab "%1"%%i

:EXIT
set GCHROME=

Please donate. Thanks.


paypal.me/jackngch
(PayPal-to-Paypal account only)

Popular Posts