/***************************************************************************/
/* Export.rexx   ©1993 Stu Churchill   2:250/107.97@fidonet                */
/*                                                                         */
/* $VER: Export.rexx 1.29 (5.9.93)                                         */
/*                                                                         */
/* Intended for use from a cron, to be called before polling for mail.     */
/***************************************************************************/

options results

spot_path = 'run mail:Spot'  /* Change this line ONLY */


if ~show('ports','SPOT') then do
  address command spot_path
  'WaitForPort SPOT'
  quit = yes                  /* Marker to close SPOT after finishing */
end

address 'SPOT'
'isiconified'
if rc = 0 then do
  icon = yes                  /* Marker to re-iconify after finishing */
  'uniconify'
end
'spot2front'


ADDRESS COMMAND "RX rexx:AutoEncrypt.spot"  /* Call the encryption script */

'export CLOSEWIN'            /* Export messages */


if icon = yes then do
  'iconify NOREQ'             /* Re-iconify if necessary */
end
if quit = yes then do
  'quitspot NOREQ'            /* Close SPOT if we had to open it ourselves */
end

exit
