Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Paragraph parsing technique?



I¹m new to AppleScript and was hoping to get some syntactical help here (at
least I hope it¹s only a syntax issue!) :-)

I would like to retrieve the paragraphs that contain a specific string from
the description field of an Entourage 2004 contact.

So far, I¹ve tried this expression:

    set theDescription to description of contact "Aaron Patterson"
    set theParagraphs to (get every paragraph of theDescription where it
contains ":ABPerson")

To which Script Editor replies:

³AppleScript Error. Can¹t get {³List²,²Of²,²Paragraphs²,²123:ABPerson²}
whose it contains ³:ABPerson²


I can loop through the paragraphs and use a contains ³:ABPerson² to pick out
those that contain the string, but that seems inefficient.

        repeat with theParagraph in (get the paragraphs of theDescription)
            if theParagraph contains ":ABPerson" then
                set theABID to theParagraph
            end if
        end repeat

To which Script Editor replies:

item 4 of {"List", "Of", "Paragraphs", "123:ABPerson"}

Can anyone offer a suggestion for how to filter a list of paragraphs
containing a specific string?

TIA!


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.