home *** CD-ROM | disk | FTP | other *** search
/ ANews 2 / AnewsCD2.iso / Script / html.rexx < prev    next >
OS/2 REXX Batch file  |  1999-10-11  |  2KB  |  108 lines

  1. /* Lanceur html */
  2.  
  3. parse arg type exe '"' filename '"'
  4.  
  5. options results
  6.  
  7. type=upper(type)
  8.  
  9. ports = show('P')
  10.  
  11. do i = 1 to words(ports)
  12.     if left(subword(ports, i), 5) = 'AWEB.'    then do
  13.        wwwport = subword(ports, i, 1)
  14.        address(wwwport)
  15.        'GET ACTIVEPORT'
  16.        if (rc = 0 ) then wwwport = result
  17.     end
  18.     if left(subword(ports, i), 7) = 'VOYAGER'  then wwwport = subword(ports, i, 1)
  19.     if left(subword(ports, i), 7) = 'IBROWSE'  then wwwport = subword(ports, i, 1)
  20.     if symbol('wwwport') = 'VAR' then break
  21. end
  22.  
  23. if symbol('wwwport') ~= 'VAR' then do
  24.   if type="IBROWSE" then call Ibrowse
  25.   if type="VOYAGER" then call Voyager
  26.   if type="AWEB" then call AWEB
  27.   exit
  28. end
  29. else do
  30.   address(wwwport)
  31.   select
  32.     when wwwport = 'VOYAGER' then call V
  33.     when wwwport = 'IBROWSE' then call IB
  34.     when left(wwwport, 5) = 'AWEB.' then call AW
  35.     otherwise nop
  36.   end
  37. end
  38.  
  39. Ibrowse:
  40. if ~show("p",'IBROWSE') then do
  41.   address command 'run >NIL: '||exe
  42. end
  43. IBloop:
  44. call delay(50)
  45. result = SHOW("p","IBROWSE")
  46. if result=0 then signal IBloop
  47. if upper(right(exe,20))=UPPER("Ibrowse2.0/IBrowse ") then call delay(50*10)
  48. IB:
  49. address 'IBROWSE'
  50. GOTOURL '"file://localhost/'filename'"'
  51. SHOW
  52. SCREENTOFRONT
  53. ACTIVATE
  54. exit
  55.  
  56. Voyager:
  57. if ~show("p",'VOYAGER') then do
  58.   address command 'run >NIL: '||exe
  59. end
  60. Vloop:
  61. call delay(50)
  62. result = SHOW("p","VOYAGER")
  63. if result=0 then signal Vloop
  64. if upper(right(exe,14))=UPPER("VOYAGER2.95/V ") then call delay(50*10)
  65. V:
  66. address 'VOYAGER'
  67. OPENURL '"file://localhost/'filename'"'
  68. SHOW
  69. ACTIVATE
  70. exit
  71.  
  72. AWEB:
  73. if ~show("p",'AWEB.1') then do
  74.   address command 'run >NIL: '||exe
  75. end
  76. AWloop:
  77. call delay(50)
  78. result = SHOW("p","AWEB.1")
  79. if result=0 then signal AWloop
  80. AW:
  81. address "AWEB.1"
  82. 'GET ACTIVEPORT'
  83. if (rc=0) then wwwport=result
  84. address value wwwport
  85. OPEN URL '"file://localhost/'filename'" RELOAD'
  86. WINDOWTOFRONT
  87. SCREENTOFRONT
  88. ACTIVATEWINDOW
  89. exit
  90.  
  91. FindBrowser:
  92.  
  93. ports = show('P')
  94.  
  95. do i = 1 to words(ports)
  96.     if left(subword(ports, i), 5) = 'AWEB.'    then wwwport = subword(ports, i, 1)
  97.     if left(subword(ports, i), 7) = 'VOYAGER'  then wwwport = subword(ports, i, 1)
  98.     if left(subword(ports, i), 7) = 'IBROWSE'  then wwwport = subword(ports, i, 1)
  99.     if symbol('wwwport') = 'VAR' then break
  100. end
  101.  
  102. if left(subword(ports, i), 5) = 'AWEB.' then do
  103.     address(wwwport)
  104.     'GET ACTIVEPORT'
  105.     if (rc = 0 ) then wwwport = result
  106. end
  107. return
  108.