home *** CD-ROM | disk | FTP | other *** search
/ ANews 1 / AnewsCD01.iso / Script / html.rexx < prev    next >
OS/2 REXX Batch file  |  1999-08-15  |  2KB  |  115 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. Say WWWPORT
  24.  
  25. if symbol('wwwport') ~= 'VAR' then do
  26.   if type="IBROWSE" then call Ibrowse
  27.   if type="VOYAGER" then call Voyager
  28.   if type="AWEB" then call AWEB
  29.   exit
  30. end
  31. else do
  32.   address(wwwport)
  33.   select
  34.     when wwwport = 'VOYAGER' then call V
  35.     when wwwport = 'IBROWSE' then call IB
  36.     when left(wwwport, 5) = 'AWEB.' then call AW
  37.     otherwise nop
  38.   end
  39. end
  40.  
  41. Ibrowse:
  42. if ~show("p",'IBROWSE') then do
  43.   address command 'run >NIL: '||exe
  44. end
  45. IBloop:
  46. call delay(50)
  47. result = SHOW("p","IBROWSE")
  48. if result=0 then signal IBloop
  49. say "*"||right(exe,20)||"*"
  50. if upper(right(exe,20))=UPPER("IbrowseDemo/IBrowse ") then call delay(50*10)
  51. IB:
  52. address 'IBROWSE'
  53. GOTOURL '"file://localhost/'filename'"'
  54. SHOW
  55. SCREENTOFRONT
  56. ACTIVATE
  57. exit
  58.  
  59. Voyager:
  60. Say "V:"
  61. if ~show("p",'VOYAGER') then do
  62.   Say "Run:"||exe
  63.   address command 'run >NIL: '||exe
  64.   Say rc
  65.   say result
  66. end
  67. Vloop:
  68. call delay(50)
  69. result = SHOW("p","VOYAGER")
  70. if result=0 then signal Vloop
  71. if upper(right(exe,14))=UPPER("VOYAGER2.95/V ") then call delay(50*10)
  72. V:
  73. address 'VOYAGER'
  74. OPENURL '"file://localhost/'filename'"'
  75. SHOW
  76. ACTIVATE
  77. exit
  78.  
  79. AWEB:
  80. if ~show("p",'AWEB.1') then do
  81.   address command 'run >NIL: '||exe
  82. end
  83. AWloop:
  84. call delay(50)
  85. result = SHOW("p","AWEB.1")
  86. if result=0 then signal AWloop
  87. AW:
  88. address "AWEB.1"
  89. 'GET ACTIVEPORT'
  90. if (rc=0) then wwwport=result
  91. address value wwwport
  92. OPEN URL '"file://localhost/'filename'" RELOAD'
  93. WINDOWTOFRONT
  94. SCREENTOFRONT
  95. ACTIVATEWINDOW
  96. exit
  97.  
  98. FindBrowser:
  99.  
  100. ports = show('P')
  101.  
  102. do i = 1 to words(ports)
  103.     if left(subword(ports, i), 5) = 'AWEB.'    then wwwport = subword(ports, i, 1)
  104.     if left(subword(ports, i), 7) = 'VOYAGER'  then wwwport = subword(ports, i, 1)
  105.     if left(subword(ports, i), 7) = 'IBROWSE'  then wwwport = subword(ports, i, 1)
  106.     if symbol('wwwport') = 'VAR' then break
  107. end
  108.  
  109. if left(subword(ports, i), 5) = 'AWEB.' then do
  110.     address(wwwport)
  111.     'GET ACTIVEPORT'
  112.     if (rc = 0 ) then wwwport = result
  113. end
  114. return
  115.