home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 28
/
amigaformatcd28.iso
/
-seriously_amiga-
/
comms
/
other
/
aemail151
/
files.lha
/
ARexx.lha
/
Addtogrp.aem
next >
Wrap
Text File
|
1998-03-21
|
3KB
|
127 lines
/* AEMail Add Name from To: & cc: headers to Address Book Group */
OPTIONS RESULTS
TRACE ALL
CURRENT IS SELECTED
IF (RESULT ~= 1) THEN DO
OKAY1 "No message is selected"
EXIT
END
TO
tolist = RESULT
IF (tolist = "") THEN DO
OKAY1 "No To: Header in message"
EXIT
END
ADDTOAB = 1
IF (ADDTOAB = 1) THEN DO
OK = 0
DO UNTIL OK = 1
GETSTRING '"Enter Group Nickname"'
grpname = RESULT
IF (grpname = "") THEN EXIT
ADDRESS_BOOK GET grpname TYPE
addrtype = RESULT
IF (addrtype = -1) THEN DO
OKAY2 '"Create It|Enter New Name|Cancel"' "Group Nickname Does Not Exist"
IF (RESULT = 1) THEN DO
GETSTRING '"Enter a Group Description"'
grpdesc = RESULT
OK = 1
OKAY2 "YES|NO" "Do you want to send header only?"
IF (RESULT = 0) THEN sndho = ""
ELSE sndho = "SHO"
END
ELSE IF (RESULT = 2) THEN OK = 0
ELSE IF (RESULT = 0) THEN exit
END
IF (addrtype = 0) THEN DO
OKAY2 '"Re-enter Name|Cancel"' "Nickname is already used for an Individual"
IF (RESULT = 1) THEN OK = 0
IF (RESULT = 0) THEN exit
END
IF (addrtype = 1) THEN OK = 1
END
END
FIRST TONAME
name1 = RESULT
IF (name1 = "") THEN EXIT
EXTRACT USERID "'"name1"'"
emailaddr=RESULT
DO UNTIL emailaddr = ""
IF (ADDTOAB = 1) THEN DO
IF (addrtype = -1) THEN DO
cmd = "ADDRESS_BOOK CREATE GROUP " grpname sndho "'"emailaddr"'" grpdesc
addrtype = 1
END
ELSE cmd = "ADDRESS_BOOK ADD TO GROUP " grpname "'"emailaddr"'"
cmd
END
NEXT NAME
IF (RC ~= 0) THEN DO
OKAY1 "last error is "AEMAIL.LASTERROR
EXIT
END
name1 = RESULT
EXTRACT USERID "'"name1"'"
emailaddr=RESULT
END
CC
IF (RESULT = "") THEN DO
OKAY1 "Last To: Name added - no cc: names"
EXIT
END
OKAY2 "YES|NO" "Do you want to add cc: names?"
IF (RESULT = 0) THEN EXIT
FIRST CCNAME
name1 = RESULT
IF (name1 = "") THEN EXIT
EXTRACT USERID "'"name1"'"
emailaddr=RESULT
DO UNTIL emailaddr = ""
IF (ADDTOAB = 1) THEN DO
IF (addrtype = -1) THEN DO
cmd = "ADDRESS_BOOK CREATE GROUP " grpname sndho "'"emailaddr"'" grpdesc
addrtype = 1
END
ELSE cmd = "ADDRESS_BOOK ADD TO GROUP " grpname "'"emailaddr"'"
cmd
END
NEXT NAME
IF (RC ~= 0) THEN DO
OKAY1 "last error is "AEMAIL.LASTERROR
EXIT
END
name1 = RESULT
EXTRACT USERID "'"name1"'"
emailaddr=RESULT
END
OKAY1 "Last CC: Name Added"