• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Paragraph parsing technique?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Paragraph parsing technique?


  • Subject: Paragraph parsing technique?
  • From: David <email@hidden>
  • Date: Fri, 28 Apr 2006 07:47:52 -0400
  • Thread-topic: 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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Paragraph parsing technique?
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: scripting Word top copy text - should be simple, but ain't
  • Next by Date: Re: Paragraph parsing technique?
  • Previous by thread: Re: ASR Error
  • Next by thread: Re: Paragraph parsing technique?
  • Index(es):
    • Date
    • Thread