home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Fax / gpfax.lha / gpfax / rexx_samples / scriptsRoss_script < prev   
Encoding:
Text File  |  1992-12-01  |  1.7 KB  |  74 lines

  1. /* GPFax v2.20 & Trapdoor v1.83 Fax Monitor */
  2. if ~show('L',"rexxsupport.library") then do
  3.    if addlib('rexxsupport.library',0,-30,0) then
  4.       call time(R)
  5.       else do
  6.         say "B ** REXXSupport.Library unavailable - Aborting...B"
  7.         exit 10
  8.    end
  9. end
  10. if ~showlist('P','REXX_GPFAX') then do
  11.    say "B ** Cannot find GPFax AREXX port - Aborting...B"
  12.    exit 10
  13.    end
  14. call open out,"con:175/12/640/150/GPFax Monitor v1.0"
  15. if ~result then do
  16.   say "B ** Cannot open CON Window - Aborting...B"
  17.   exit 10
  18.   end
  19. endif
  20. openport("FaxMon")
  21. num=0
  22. comm=" "
  23. call writeln out,"GPFax Monitor activated: "time(C)
  24. /* Idle and process loop */
  25. do forever
  26. call writeln out,"*Awaiting Command*"
  27. waitpkt("FaxMon")
  28. num=getpkt("FaxMon")
  29. comm=upper(getarg(num))
  30. call writeln out,"B TASK: "comm
  31. if comm="NOTIFY" then do
  32.   reply(num,0)
  33.   options results
  34.   address rexx_gpfax
  35.   reportlog R 3
  36.     if left(result,2)="OK" then do
  37.       reportlog R 4
  38.       name=trim(result)
  39.       reportlog R 2
  40.       pages=trim(result)
  41.       reportlog R 5
  42.       info=trim(result)
  43.       call writeln out,"FAXIN: "name" ("pages" pages) ["info"]"
  44.       reportlog R 1
  45.       fname=trim(result)
  46.       call writeln out," FILE: "fname""
  47.       viewfax result
  48.     end
  49. end
  50. if comm="VIEWLAST" then do
  51.   reply(num,0)
  52.   call writeln out,"BViewing last fax received..."
  53.   options results
  54.   address rexx_gpfax
  55.   viewlast
  56. end
  57. if comm="PRINTLAST" then do
  58.   reply(num,0)
  59.   call writeln out,"BPrinting last fax received..."
  60.   options results
  61.   address rexx_gpfax
  62.   printlast
  63. end
  64. if comm="QUIT" then do
  65.   reply(num,0)
  66.   call writeln out,"BExiting Fax Monitor..."
  67.   address command "wait 1"
  68.   exit 0
  69. end
  70. num=0
  71. comm=" "
  72. end
  73.  
  74.