home *** CD-ROM | disk | FTP | other *** search
/ Amiga Times / AmigaTimes.iso / programme / Fiasco_2.2 / Databases / Organizer / mail.frx < prev   
Encoding:
Text File  |  1998-10-06  |  1.7 KB  |  97 lines

  1. /* mail.frx
  2.  * Copyright © 1997 Nils Bandener
  3.  * Partly based on example ARexx scripts from various mail programs:
  4.  *  - VOYAGERmail.rexx © 1996 Marcel Beck
  5.  * $VER: mail.frx 6.2 (20.10.97)
  6.  */
  7.  
  8. /* Well, it currently supports only one mail program, namely YAM.
  9.  * YAM is the only program I have found so far, that supports the
  10.  * neccessary ARexx commands. Thor may support these too, but somehow
  11.  * I did not get it to work.
  12.  *
  13.  * Feel free to modify this script to suit your own needs (or mail
  14.  * program ;) . It would be nice if you send me a copy of your script
  15.  * that I can add support for the mail program to this script
  16.  */
  17.  
  18. scriptname = "Mail"
  19.  
  20. fieldname = "eMail"
  21.  
  22. Options Results
  23.  
  24. fiasco_port = address()
  25.  
  26. Signal on Syntax
  27. Signal on Halt
  28. Signal on Break_C
  29. Signal on Failure
  30.  
  31. LockGUI
  32.  
  33. GetField fieldname "var addr"
  34.  
  35. if ~show("p", "YAM") then
  36. do
  37.     Address Command
  38.  
  39.     "RUN >NIL: YAM:YAM NOCHECK"
  40.     "SYS:REXXC/WAITFORPORT YAM"
  41. end
  42.  
  43. if show("p", "YAM") then
  44. do
  45.     Address YAM
  46.     MailWrite
  47.     WriteMailTo addr
  48. end
  49.  
  50. bail_out:
  51.  
  52. Interpret Address fiasco_port
  53.  
  54. UnlockGUI
  55. ResetStatus
  56.  
  57. exit
  58.  
  59. syntax:
  60. failure:
  61.  
  62. if show("Ports", fiasco_port) then
  63. do
  64.     Interpret Address fiasco_port
  65.  
  66.     RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
  67. end
  68. else
  69. do
  70.     say "Error" rc "in line" sigl ":" errortext(rc)
  71.     say "Enter to continue"
  72.     pull dummy
  73. end
  74.  
  75. call bail_out
  76.  
  77. halt:
  78. break_c:
  79.  
  80. if show("Ports", fiasco_port) then
  81. do
  82.     Interpret Address fiasco_port
  83.  
  84.     RequestChoice '"Script Abort Requested" "Abort Script" Title "' || scriptname || '"'
  85.  
  86. end
  87. else
  88. do
  89.     say "*** Break"
  90.     say "Enter to continue"
  91.     pull dummy
  92. end
  93.  
  94. call bail_out
  95.  
  96.  
  97.