Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Multi-Window Browser


  • Please log in to reply
2 replies to this topic
David
  • Members
  • 25 posts
  • Last active: Mar 17 2008 06:37 PM
  • Joined: 08 Aug 2004
A short program that creates and runs an HTM file displaying your favorite sites, with each site in a separate full-window iframe. Your sites are found in mwb.dat, one line per site, with each line containing a title, a comma (with no following space), and the URL. Lots of room for improvement but it does the job for me.

; Multi-Window Browser (mwb.ahk)
;
; This program creates an HTML file containing one window for each URL
; in the mwb.dat file, which must exist in the same directory as mwb.ahk.
; Example mwb.dat file (start in column one, omit semicolons):
;   Fox News,http://www.foxnews.com/
;   Drudge,http://www.drudgereport.com/
;   Late Night Jokes,http://www.newsmax.com/liners.shtml
;   Sudoku,http://www.websudoku.com/

fileName = %A_WorkingDir%\mwb
htmFile  = %fileName%.htm
datFile  = %fileName%.dat

IfNotExist, %datFile%
{
  MsgBox, URL file not found:`n`n%datFile%`n`nExiting ...
  Exit
}

IfExist, %htmFile%
  FileRecycle, %htmFile%

FileAppend, <html>`n, %htmFile%
FileAppend, <head>`n, %htmFile%
FileAppend, <title>MultiWindow Browser</title>`n, %htmFile%
FileAppend, <style type="text/css">`n, %htmFile%
FileAppend, /*<![CDATA[*/`n, %htmFile%
FileAppend, body { margin: 0px 0px 0px 0px }`n, %htmFile%
; Next line is long
FileAppend, h1 { background-color: #000000; color: #ffffff; text-align: center; margin-top: 0px; margin-bottom: 0px; padding-top: 16px; padding-bottom: 16px; }`n, %htmFile%
FileAppend, /*]]>*/`n, %htmFile%
FileAppend, </style>`n, %htmFile%
FileAppend, </head>`n, %htmFile%
FileAppend, <body>`n, %htmFile%

Loop, Read, %datFile%, %htmFile%
{
  Loop, Parse, A_LoopReadLine, CSV
  {
    IfEqual, A_Index, 1
    {
      FileAppend, <h1>
      FileAppend, %A_LoopField%
      FileAppend </h1>`n
    }
    Else
    {
      FileAppend, <iframe src="
      FileAppend, %A_LoopField%
      FileAppend, " width="100`%" height="100`%" frameborder="0"></iframe>`n
    }
  }
}

FileAppend, </body>`n</html>`n, %htmFile%

Run, %htmFile%, %A_WorkingDir%
Exit


  • Guests
  • Last active:
  • Joined: --
This multi-window browser is an excellent idea!
Thanks for sharing it. Please do not hesitate to post new ideas or improvements.

David
  • Members
  • 25 posts
  • Last active: Mar 17 2008 06:37 PM
  • Joined: 08 Aug 2004
Forgot to post an example: http://members.cox.n...avid193/mwb.htm