home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Enigma Amiga Life 113
/
EnigmaAmiga113CD.iso
/
software
/
varie
/
fwcalendar
/
fwcdocs
/
sendtobrowser.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-11-30
|
2KB
|
71 lines
/* SendToBrowser.rexx */
parse arg SendFile
if SendFile == '' then SendFile = 'index.html'
options results
parse source . . . FullCallPath .
ScriptDir = PathPart(FullCallPath)
if open('Browser', 'ENV:Browser') == 0 then do
address command 'REQUESTFILE >ENVARC:Browser TITLE "Locate your preferred browser:" NOICONS'
if open('Temp', 'ENVARC:Browser') then do
BrowserPath = readln('Temp')
if BrowserPath == '' then call Cleanup('ENVARC')
call close('Temp')
end
else call Cleanup('ENVARC')
address command "copy >NIL: ENVARC:Browser ENV:Browser QUIET"
if open('Temp', 'ENV:Browser') then do
if readln('Temp') ~= BrowserPath then call Cleanup('ENV')
call close('Temp')
end
else call Cleanup('ENV')
if open('Browser', 'ENV:Browser') == 0 then exit
end
BrowserLoc = strip(readln('Browser'), 'B', '"')
if ~exists(BrowserLoc) then exit
Browser = upper(NameOnly(BrowserLoc))
select
when pos('IBROWSE', Browser) > 0 then do
URL$ = 'file://localhost/'ScriptDir''SendFile
if pos('IBROWSE', show("P")) > 0 then address 'IBROWSE' "GOTOURL "URL$
else address command 'run 'BrowserLoc' 'URL$
end
when pos('AWEB', Browser) > 0 then do
URL$ = 'file:///'ScriptDir''SendFile
if pos('AWEB.1', show("P")) > 0 then address 'AWEB.1' "OPEN "URL$
else address command 'run 'BrowserLoc' 'URL$
end
when Browser == 'V' then do
URL$ = 'file:///'ScriptDir''SendFile
if pos('VOYAGER', show("P")) > 0 then address 'VOYAGER' "OPENURL "URL$
else address command 'run 'BrowserLoc' 'URL$
end
otherwise nop
end
exit
Cleanup:
parse arg Dest
say 'Unable to write browser information to 'Dest':Browser'
exit
/***//******* NameOnly (NO) Subroutine ***********/
NameOnly:
parse arg FullPath
return substr(FullPath, max(lastpos(':', FullPath), lastpos('/', FullPath)) + 1)
/**/
/***//******* PathPart (PP) Subroutine ***********/
PathPart:
parse arg PP_FileWithPath
return left(PP_FileWithPath, max(lastpos(':', PP_FileWithPath), lastpos('/', PP_FileWithPath)))
/**/