home *** CD-ROM | disk | FTP | other *** search
/ The AGA Experience 2 / agavol2.iso / software / utilities / comms / html-heaven / arexx / html-edword5.rexx < prev    next >
OS/2 REXX Batch file  |  1996-01-08  |  1KB  |  38 lines

  1. /* HTML-Helper Arexx script sample
  2.  * Ver      : 1.2 (7th January 1996)
  3.  * Copyright: Paul Kolenbrander (InterNet: paul@serena.iaehv.nl)
  4.  * Function : Pass on the HTML commands from HTML-Helper to EdWord Pro.
  5.  * Author   : Martin Reddy, <mxr@dcs.ed.ac.uk>,
  6.               Simon Dick, <sidick@essex.ac.uk>
  7.  * Input    : HTMLCMD - The HTML command to be inserted.
  8.  */
  9.  
  10. OPTIONS RESULTS                               /* enable return codes */
  11. PARSE ARG MYCMD HTMLCMD
  12.  
  13. HTMLCMD = SUBSTR(HTMLCMD,2, LENGTH(HTMLCMD)-1) /* strip leading space  */
  14.  
  15. ADDRESS 'EDWORD'                              /* The editor's ARexx port */
  16.  
  17. IF POS('><',HTMLCMD) ~= 0 THEN DO             /* Is it a split command */
  18.    IsSelected
  19.    IF (RESULT = -1) THEN DO
  20.       CMD2 = right(HTMLCMD,(LENGTH(HTMLCMD)-(LASTPOS('<',HTMLCMD))+1))
  21.       CMD1 = substr(HTMLCMD,1,(LENGTH(HTMLCMD)-LENGTH(CMD2)))
  22.       SetView OFF
  23.       SetMark 3
  24.       JumpToBlockStart
  25.       InsertText CMD1
  26.       JumpToBlockEnd
  27.       InsertText CMD2
  28.       JumpToMark 3
  29.       BlockOff
  30.       SetView ON
  31.       END
  32.    ELSE
  33.       InsertText HTMLCMD
  34.    END
  35. ELSE
  36.    InsertText HTMLCMD                         /* the Insert command */
  37. EXIT                                          /* And exit the script.*/
  38.