home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / texed133.zip / English.zip / Macro.cmd < prev    next >
OS/2 REXX Batch file  |  1995-09-19  |  2KB  |  49 lines

  1. /*
  2.  *   You are allowed to enter every ReXX command.
  3.  *   Some additional command are mentioned below
  4.  */
  5.  
  6.    say 'Macro has started'
  7.  
  8. /***************************************************************************/
  9. /* Get marked text                                                         */
  10. /* a) with clipboard: (Cut and Copy are also possible)                     */
  11.  
  12.    ok = VRMethod( "MLE_1", "Copy")
  13.    MarkierterText = VRMethod( "Application", "GetClipboard")
  14.  
  15. /* b) direct:
  16.  
  17.    MarkierterText = VRGet( "MLE_1", "SelectedText") */
  18.  
  19. /***************************************************************************/
  20. /* Standart ReXX function                                                  */
  21.  
  22.    laenge = length(MarkierterText)
  23.  
  24. /***************************************************************************/
  25. /* Get position of the mark                                                */
  26.  
  27.    Markierung_Start = VRGet( "MLE_1", "SelectedStart")
  28.    Markierung_Ende  = VRGet( "MLE_1", "SelectedEnd")
  29.  
  30. /***************************************************************************/
  31. /* Set mark from MarkierungStart to MarkierungEnde                         */
  32.  
  33.    ok = VRSet( "MLE_1", "SelectedStart", Markierung_Ende)
  34.    ok = VRSet( "MLE_1", "SelectedEnd", Markierung_Ende)
  35.  
  36. /***************************************************************************/
  37. /* Some ways to insert text                                                */
  38.  
  39.    ok = VRMethod( "MLE_1", "Insert", " (Length of marked text: " )
  40.  
  41.    ok = VRMethod( "Application", "PutClipboard", laenge)
  42.    ok = VRMethod( "MLE_1", "Paste" )
  43.  
  44.    ok = VRMethod( "MLE_1", "Insert", ")" )
  45.  
  46. /***************************************************************************/
  47. say "ok"
  48.  
  49.