CALL view_error_message("Download directory '" || download_directory || "' not found.*NMake sure it exists and that it is accessible.")
EXIT 10
END
/* If no browser port has been specified, find out which port to use */
IF (port = "") THEN DO
/* Assume that current host is a browser */
port = ADDRESS()
IF ((LEFT(port, 4) ~= 'AWEB') ,
| (LEFT(port, 7) ~= 'IBROWSE')) ,
THEN DO
/* Current host has turned out to be useless (e.g. 'REXX' if started
* from a plain CLI), therefore try to find the default port of any
* of the supported browsers */
IF SHOW('P', 'AWEB.1') THEN DO
port = 'AWEB.1'
END
ELSE IF SHOW('P', 'IBROWSE') THEN DO
port = 'IBROWSE'
END
ELSE DO
/* No supported browser found. Abort with error message. */
CALL view_error_message("Could not find ARexx port of any supported browser.*NMake sure your browser is supported and running at*Nits default ARexx port or start script from browser.")
EXIT 10
END
END
END
/* Assign browser port */
browser.port = port
IF verbose THEN DO
/* Tell the user which browser we are using */
SAY "Using browser in port '" || browser.port || "'"
SAY
END
/* Assign browser ARexx commands */
IF LEFT(browser.port,4) = 'AWEB' THEN DO
/* AWeb */
browser.open = 'Open Reload'
browser.query_uri = 'Get URL'
browser.activate.count = 2
browser.activate.1 = 'ActivateWindow'
browser.activate.2 = 'WindowToFront'
END
ELSE IF LEFT(browser.port,7) = 'IBROWSE' THEN DO
/* iBrowse */
browser.open = 'GotoURL'
browser.query_uri = 'Query URL'
browser.activate.count = 2
browser.activate.1 = 'Show'
browser.activate.2 = 'ScreenToFront'
END
ELSE DO
/* Unknown browser */
CALL view_error_message("Browser at port '" || browser.port || "' is not supported*NRefer to the manual to learn which browsers are.")
EXIT 10
END
/* Check, if browser is available */
IF ~SHOW('P', browser.port) THEN DO
/* No; abort with error message */
CALL view_error_message("Could not find WWW browser in port '" || browser.port || "'.*NStart browser before using this script.")
EXIT 10
END
/*
* Ask for additional options
*/
IF (ask) THEN DO
/* Open rexxreqtools.library */
IF ~SHOW('L', 'rexxreqtools.library') THEN DO
IF ~ADDLIB('rexxreqtools.library', 0, -30, 0) THEN DO
CALL view_error_message("Library 'rexxreqtools.library' not found.*NRefer to the manual where to obtain it from.")
END
END
IF further THEN DO
/* Only further options are asked and the options passed in the
* command line are not displayed in the requester */
ask_options = ''
options = options || ' '
further_text = ' further '
END
ELSE DO
/* Display options passed in the command line in the requester
* so that the user can edit all of them */
ask_options = options
options = ''
further_text = ' '
END
IF continue THEN DO
/* Obtain options used to be displayed as default in requester
* from the clip.
*
* Note that this can discard all options passed in the CLI if
* <further> was not specified.*/
ask_options = GetClip(clip)
END
ELSE DO
/* Reset the Clip and use the options already in <ask_options>
* as default requester content */
SetClip(clip, "")
END
/* Ask for additional options. If the user cancels the requester,