[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 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 - Add Replied Address to Contacts

Add Replied Address to Contacts

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Add Replied Address to Contacts

Postby Eric » Tue Oct 19, 2004 7:07 am

Monbidoux wrote:Found this script in my filed data. Must be from Scripts section of this site.


Code: Select all
{ Script: Add Replied Address to Contacts
{ Created: Nov 17 2001
{ Author: Bryan Pfaffenberger <bp@virginia.edu>
{ Purpose: Emulates Outlook's option "Add contact information for people I
reply to"
{ Mode: This script should be included in a filter run against outgoing
messages

{  Modifications:
{   7Mar2002 - Allow configuration of prompts for both already in address book
and a new function to prompt for addition.  - M.Motek
{ 22Apr2002 - Support prompt for nickname. M.Motek
{ 18Jun2002 - Do not delete entry if no nickname entered.
{                 - Check Poco build number.
{                 - Removed code for handling null fields (PocoScript bug
fixed). M.Motek

Set $OnErrorGoTo ErrorHandler

External $userdata1 "Show message when already in book?" "No"
External $userdata2 "Prompt to add new entries?" "Yes"
External $userdata3 "Prompt for nickname?" "No"
ImportSettings

Call CheckPocoVersion

ReadHeader $addressItem "To:" %message
IsAddressPresent &present $addressItem
If &present Then Stop

LowerCase $userdata2
If $userdata2 = "no" Then AddToBook
AddStrings $msg "Do you want to add " $AddressItem " to your "
$CurrentAddressBook " 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

:Done
Exit

:Stop
LowerCase $userdata1
If $userdata1 = "no" Then Done
MessageBox "Contact already in address book"
Exit

:ErrorHandler
   MessageBox "Terminating due to fatal error."
Exit

{-----------------------------------------------------------------------------
------------------------------------------------------------------------------
--------------------------------
{ Sub: CheckPocoVersion
{ Purpose: Checks to see that the user is running the correct version of Poco
for this script. If they aren't then the script will
{               recommend which version of the script should be used.
{-----------------------------------------------------------------------------
------------------------------------------------------------------------------
--------------------------------
:CheckPocoVersion
   If #PocoVersion > 1044 Then Return
   AddStrings $msg "The " $PocoScriptName " script will not operate properly
unless you are using Poco build 1045 or later."
   If #PocoVersion > 1006 Then UsingBeta
      AddStrings $msg "Please use the AddRecipient3 script with Poco build
1006 (Poco 2.6 public release)."
      GoTo ShowVersionMsg
:UsingBeta
   AddStrings $msg " Use either the AddRecipient or AddRecipient2 scripts for
build " #PocoVersion "."
:ShowVersionMsg
   AddStrings $msg "  Upgrade to the " $PocoScriptName " script when you
upgrade to build 1045 or later."
   MessageBox $msg
Exit
Eric
 

Postby Michael » Tue Oct 19, 2004 2:46 pm

Just a note, watch for word wrapping in the above script, many of the lines are wrapped. I'd definitely advise getting this script from the extras area.
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Postby MonBidoux » Sat Nov 27, 2004 1:08 am

Thanks for the tip Michael. Missed your reply, guess i didn't have the "notify me" bit on.

Thought there was something funny going on with it. Will download it as soon i get the right code name to access the extras section. Pm'd support on this. As they did in the past, I'm sure they'll help me out on it again. Won't go into any details 'cause then it wouldn't fit in this thread anymore.

-p.s. just tried again with IE and access to Extras section worked fine. Wrote to Support to advise them that i could not access with Firefox 1.0 (default) browser.

Thanks again for helping out Michael. Wish i knew how to make scripts. Lucky guy!
MonBidoux
Poco Enthusiast
 
Posts: 323
Joined: Sun Jul 25, 2004 10:19 pm
Location: Lac-Etchemin

Postby Pete » Tue Nov 30, 2004 4:40 am

FYI, I can access the Extras section with Firefox now (I couldn't on the 27th).
Pete
 

Postby MonBidoux » Tue Nov 30, 2004 6:28 am

Thanks Pete. Can access extras section now as well. Problem resolved!
MonBidoux
Poco Enthusiast
 
Posts: 323
Joined: Sun Jul 25, 2004 10:19 pm
Location: Lac-Etchemin


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 2 guests

cron