/*****************************************************************************
                 SpotChef V2.2 - By Ian Forest (2:250/188.100)
                      Copyright 1995, All rights reserved
******************************************************************************

Make sure that you edit the areas where the language files are kept!!!

*****************************************************************************/

TEMPDIR = 'T:'

Address Spot
options results
cr = '0d'x

'IsMessages'
If RC>0 Then Do
  'RequestNotify PROMPT "Use only from the message window!"'
   Exit
End

'requestresponse TITLE "Spot Chef V2.2 - (c)1995 Ian Forest (2:250/188.100)" PROMPT "Please choose a language (default is CHEF)" GADGETS "_Chef|_Jive|_ValSpeak|_Kraut|_Cancel" CENTER'
select
	when RC=0 then exit
	when RC=1 then LANG="C:Chef"
	when RC=2 then LANG="C:Jive"
	when RC=3 then LANG="C:ValSpeak"
        when RC=4 then LANG="C:Kraut"
	otherwise 
end

'GetSubject'
SUBJECT=Result

'GetTo'
TO=Result

'GetFrom'
FROM=Result

'SaveAscii TO "'TEMPDIR'SpotChef.temp" OVERWRITE NOHEADER NOTEARLINE NOORIGIN NOKLUDGES'

If ~Open('Inp',TEMPDIR'SpotChef.temp','r') Then Do
   'RequestNotify PROMPT "Cannot open temporary file:'TEMPDIR'SpotChef.temp"'
   Exit
   End
call close('Inp')

Address Command LANG' <'TEMPDIR'SpotChef.temp >>'TEMPDIR'SpotChef2.temp'
Address Command 'Delete >NIL: T:SpotChef.temp'
Address Spot

'requestresponse TITLE "Spot Chef V2.2 - (c)1995 Ian Forest (2:250/188.100)" PROMPT "Keep current message nuke it?" GADGETS "_Keep|_Nuke!|_Cancel" CENTER'
select
	when RC=0 then exit
	when RC=2 then deletemessage NOREQ
	otherwise 
end

'RequestResponse PROMPT "Edit message?" GADGETS "_Yes|_No"'
wib = RC
if wib=1 Then 'Write TO "'TO'" FROM "'FROM'" TOADDR "'fromaddr'" SUBJECT "[SC2.2] 'SUBJECT'" FILE "'TEMPDIR'SpotChef2.temp" NOSIG NOGUI'
if wib=0 Then 'Write TO "'TO'" FROM "'FROM'" TOADDR "'fromaddr'" SUBJECT "[SC2.2] 'SUBJECT'" FILE "'TEMPDIR'SpotChef2.temp" NOSIG NOEDIT NOGUI'
Address Command
'Delete >NIL: T:SpotChef2.temp'
