Title: Re: Changing email domains and Company via Script
You could change his first line to:

    set ourStaff to every contact whose company contains "widgets"

or whatever is appropriate, using the same "rough approximation" that you might do in an Advanced Find. 'contains' is case-insenstitve so it will include "Widgets" as well as "widgets".

Alternately, to make it a little less automated, you could do an Advanced Find instead, using various "if ANY criteria are met"  and use your judgment to select only those contacts in the Search Results which really are ones you want to change, excluding the others. Then the first line would be

    set ourStaff to the selection


However, if you're pretty sure of "widgets" or any other determinant, you could actually do this much faster with this script:

    tell application "Microsoft Entourage"
        set company of (every contact whose company contains "widgets" or company contains "associated") to "Our New Name"
    display dialog "All done!"
    end tell


No repeat loop needed when done that way.

--
Paul Berkowitz




From: Lindsley Williams <[EMAIL PROTECTED]>
Reply-To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
Date: Wed, 06 Aug 2003 06:14:27 -0400
To: Entourage <[EMAIL PROTECTED]>
Subject: Re: Changing email domains and Company via Script

Allen’s approach assumes, of course, that the user has systematically and precisely entered the “company name” in exactly the same fashion on each relevant contact.  That’s not likely given human nature, certainly not mine.  But, where it counts, in the email address, consistency is the only way to get the deliveries you want.  Ergo, the search should be for any portion of all email address fields that contain the relevant domain name, n’est ce pas?  Curiously, in the now largely displaced Outlook Express, its contact “finder” would do just that, when asked, directly.  I’d think that would also work in Entourage, i.e., it would isolate all contacts meeting the “old domain name” criteria.  But, it would not change them, which is what Michael wanted in the first place.


From: Allen Watson <[EMAIL PROTECTED]>
Reply-To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
Date: Tue, 05 Aug 2003 22:08:47 -0700
To: Entourage mac Talk <[EMAIL PROTECTED]>
Subject: Re: Changing email domains and Company via Script

On or near 8/5/03 3:49 PM, Michael Scheurer at [EMAIL PROTECTED] observed:

> Hi all,
> the place I work for has recently changed names and email domain. I'm
> looking to change 400+ contacts. I'll need to change Company name and the
> domain name in selected email addresses.
>
> Before I start to write a script, has anyone written such an animal already?
>
>
I've not seen anything posted, but it should be straightforward enough. Go for it! You might start with:

    tell application "Microsoft Entourage"
        set ourStaff to every contact whose Company is "Consolidated Widgets" -- Use appropriate company name
        repeat with aContact in ourStaff
            -- Do stuff here
        end repeat
    end tell
--
Microsoft MVP for Entourage/OE/Word (MVPs are volunteers)
Allen Watson <[EMAIL PROTECTED]> Entourage FAQ site: <http://www.entourage.mvps.org/>
AppleScripts for Outlook Express and Entourage:
 <http://members.thinkaccess.net/[EMAIL PROTECTED]/Scripts/>
Entourage Help Pages: <http://www.entourage.mvps.org/>


Reply via email to