RE: Simple text question
RE: Simple text question
- Subject: RE: Simple text question
- From: "Script2" <email@hidden>
- Date: Mon, 7 Jul 2008 13:38:05 -0400
- Importance: Normal
Thanks Michelle
This works.
But when I try
Set wordcnt to number of words in aword
Set newword to word cnt thru wordcnt of aword - it ignore the "[]" and "()"
Cnt is a counter - which word contains "[F]"
Ruby
-----Original Message-----
From: applescript-users-bounces+script2=email@hidden
[mailto:applescript-users-bounces+script2=email@hidden]
On Behalf Of Michelle Steiner
Sent: Monday, July 07, 2008 1:15 PM
To: Applescript Users
Subject: Re: Simple text question
On Jul 7, 2008, at 10:03 AM, Script2 wrote:
> I want to test which word contains [F].
The problem is that Applescript doesn't consider non alpha-numerics as
part of words.
So no word contains "[F]"
This might solve your problem:
set a to "6000[F]this is test (#1)."
set text item delimiters to space
set a to text items of a
repeat with b in a
if b contains "[f]" then
set found to contents of b
exit repeat
end if
end repeat
found
--> "6000[F]this"
-- Michelle
--
"Every gun that is made, every warship launched, every rocket fired,
signifies in the final sense a theft from those who hunger and are not
fed, those who are cold and are not clothed."
President Dwight D. Eisenhower, April 16, 1953
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
tern.com
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden