Re: Parsing text from a string
Re: Parsing text from a string
- Subject: Re: Parsing text from a string
- From: "Marc K. Myers" <email@hidden>
- Date: Wed, 16 Mar 2005 20:00:55 -0500
On Mar 16, 2005, at 3:01 PM, Todd Geist <email@hidden>
wrote:
Hello again.
I am just full of questions today :>)
If I have the string "Have a [Nice] [Day]"
I want what is in the first set of brackets "Nice". The brackets will
always be somewhere in the string and I want what is in side of them.
Thanks so much for all your help?
set theText to "Have a [Nice] [Day]"
set {od, AppleScript's text item delimiters} to ¬
{AppleScript's text item delimiters, "]"}
set x to text items of theText
set AppleScript's text item delimiters to "["
set z to ""
repeat with anItem in x
set y to text items of anItem
if (count of y) > 1 then
set z to last item of y
exit repeat
end if
end repeat
set AppleScript's text item delimiters to od
z
--> "Nice"
Marc [3/16/05 7:59:36 PM]
_______________________________________________
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