home *** CD-ROM | disk | FTP | other *** search
- /* HTML-Helper Arexx script for Final Writer
- * Ver : 1.2 (7th January 1996)
- * Author : Paul Kolenbrander (paul@serena.iaehv.nl)
- * Function : Pass on the HTML commands from HTML-Heaven to Final Writer.
- * Input : HTMLCMD - The HTML command to be inserted.
- */
-
- OPTIONS RESULTS /* enable return codes */
- OPTIONS FAILAT 11 /* Needed for block detect */
- PARSE ARG MYCMD HTMLCMD
- HTMLCMD = SUBSTR(HTMLCMD,2, LENGTH(HTMLCMD)-1) /* strip leading space */
-
- ADDRESS 'FINALW.1' /* Default, edit if needed */
-
- TextTool /* Make sure we're in text */
-
- HTMLCMD = SUBSTR(HTMLCMD,2, LENGTH(HTMLCMD)-2) /*strip leading/trailing " */
-
- TagColor = Blue /* Default tag color Blue */
- TekstColor = Black /* Default text color Black */
- PairColor = Magenta /* Default pair tag Magenta */
- Status FontColor /* Get the textcolor and do */
- Parse VAR Result TekstColor /* check if it's not blue */
- IF UPPER(TekstColor) = 'BLUE' THEN DO
- TagColor = Red /* if text = blue, tag = red*/
- END
- IF UPPER(TekstColor) = 'MAGENTA' THEN DO
- PairColor = Red /* if text = blue, pair= red*/
- END
-
- Status LinePos
- Parse VAR Result BeginLine BeginPosition EndLine EndPosition
-
- IF (WORDS(Result) = 4) THEN DO
- IF POS('><',HTMLCMD) ~= 0 THEN DO /* Is it a split command? */
- /* If yes, then.... */
-
- CMD2 = right(HTMLCMD,(LENGTH(HTMLCMD)-(LASTPOS('<',HTMLCMD))+1))
- CMD1 = substr(HTMLCMD,1,(LENGTH(HTMLCMD)-LENGTH(CMD2)))
- MoveToLine BeginLine BeginPosition /* Move to beginning */
- FontColor PairColor
- Type CMD1 /* Insert begin TAG */
- FontColor TekstColor
- MoveToLine EndLine EndPosition+LENGTH(CMD1) /* Move to end */
- FontColor PairColor
- Type CMD2 /* Insert end TAG */
- FontColor TekstColor
- END
- ELSE DO
- MoveToLine BeginLine BeginPosition /* Move to beginning */
- FontColor TagColor
- Type HTMLCMD /* Insert TAG */
- FontColor TekstColor
- END
- END
- else DO
- FontColor TagColor
- Type HTMLCMD /* Insert at current pos */
- FontColor TekstColor
- END
-
- IF MYCMD = 'SAVE' THEN DO /* If AutoView On, then get*/
- Status Pathname /* the name of the file and*/
- Parse VAR bestand /* Save it as an ASCII file*/
- Save ASCII bestand
- IF bestand = '' THEN DO /* Display it in a browser */
- ADDRESS COMMAND 'rx S:HTMLVIEW.rexx'
- END
- ELSE DO
- ADDRESS COMMAND 'rx S:HTMLVIEW.rexx '||bestand
- END
- END
-
- EXIT /* And exit the script. */
-