Paragraph parsing technique?
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