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

  1. /* HTML-Helper Arexx script for Annotate
  2.  * Ver      : 1.1 (7th January 1995)
  3.  * Author   : paul Kolenbrander (paul@serena.iaehv.nl)
  4.  * Function : Pass on the HTML commands from HTML-Helper to Annotate.
  5.  * Input    : HTMLCMD - The HTML command to be inserted.
  6.  * Caveat   : you'll need to load the document into your browser manually
  7.  *            the first time. As I can't find a commmand to get the filename
  8.  *            from Annotate, I can only tell the browser to do a reload.  
  9. */
  10.  
  11. OPTIONS RESULTS                               /* enable return codes     */
  12. PARSE ARG MYCMD HTMLCMD
  13. HTMLCMD = SUBSTR(HTMLCMD,2, LENGTH(HTMLCMD)-1) /* strip leading space     */
  14.  
  15. ADDRESS 'Annotate_Rexx'                       /* Default, edit if needed */
  16.  
  17. HTMLCMD = SUBSTR(HTMLCMD,2, LENGTH(HTMLCMD)-2) /* strip leading/trailing " */
  18.  
  19. IF POS('><',HTMLCMD) ~= 0 THEN DO             /* Is it a split command?  */
  20.                                               /* If yes, then....        */
  21.    GET SEL_SIZE                               /* Check if block selected */
  22.    IF result ~= "RESULT" THEN DO              /* Block selected          */
  23.       PARSE VAR result beginx beginy endx endy
  24.       CMD2 = right(HTMLCMD,(LENGTH(HTMLCMD)-(LASTPOS('<',HTMLCMD))+1))
  25.       CMD1 = substr(HTMLCMD,1,(LENGTH(HTMLCMD)-LENGTH(CMD2)))
  26.       MOVE_CURSOR ABS endx endy
  27.       INSERT STRING CMD2                      /* Insert at block end     */
  28.       MOVE_CURSOR ABS beginx beginy
  29.       INSERT STRING CMD1                      /* Insert at block begin   */
  30.    END
  31.    ELSE
  32.       INSERT STRING HTMLCMD                   /* Insert at current pos   */
  33.    END
  34. ELSE
  35.    INSERT STRING HTMLCMD                      /* Insert at current pos   */
  36.  
  37. IF MYCMD = 'SAVE' THEN DO                     /* I can't find a command  */
  38.    DOMENU SAVE                                /* to make Annotate part   */
  39.    ADDRESS COMMAND 'rx S:HTMLVIEW.rexx'       /* with the filename.      */
  40. END
  41.  
  42. EXIT                                          /* And exit the script.    */
  43.  
  44.