[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Poco Forums • View topic - Address Book Nickname

Address Book Nickname

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Address Book Nickname

Postby SFCurley » Sun Sep 05, 2004 4:59 am

The following code is from the AddRecipient3 script, which promts on whether or not to add a sender's email address to AddressBook and also asks if you'd like to supply nickname. If you do add nickname, then it appears to delete the address and add it back with the nickname field. In practice however (at least for me), it deletes the entry from the adress book (after it had added it without nickname) and then adds back an entry that has only the nickname and nothing else. I looked for other examples in the sript library and at the documentation, but didn't see how I really should do this. Any ideas. Thanks in advance.

AddStrings $msg "NEW SENDER: Do you want to add " $AddressItem " to your Address Book?%var%"
InputBox $answer $msg "Yes|No"
LowerCase $answer
If $answer ! "yes" Then Done

:AddToBook
AddAddress $CurrentAddressBook $AddressItem

LowerCase $userdata3
If $userdata3 = "no" Then Done

Set $EMailAddress $AddressItem
ExtractEMail $EMailAddress
GetRawAddress $AddressItem $EMailAddress $CurrentAddressBook

InputBox $nickname "What nickname would you like to use?"
Trim $nickname
If $nickname = "" Then Done

RemoveAddress $CurrentAddressBook $EMailAddress

DeleteLine $AddressItem 0 1
InsertLine $AddressItem 0 $NickName

AddRawAddress $CurrentAddressBook $AddressItem
SFCurley
 

Postby SFCurley » Sun Sep 05, 2004 7:25 am

Well, figured it out myself. Turns out the AddRecipient3 Script either has a bug in it OR perhaps, more accurately, the GetRawAddress function doesn't work quite as documented.

The GetRawAddress documentation says it reads the address into a MULTI-line variable, which the AddRecipient3 script relied on. In my testing, GetRawAdress actually read into a SINGLE-line variable. I had to add a "ReadCSV $entry $entry" line after the GetRawAddress command to get the address record parsed into a multi-line variable. Once I did that, all worked as it was supposed to.
SFCurley
 

Postby Pete » Sun Sep 05, 2004 10:59 am

There's some useful documentation about this in the previous forums (when they become available).
Pete
 


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 2 guests

cron