Re: Text items
Re: Text items
- Subject: Re: Text items
- From: Emmanuel <email@hidden>
- Date: Tue, 16 Jan 2007 19:51:32 +0100
Title: Re: Text items
At 1:12 PM -0500 1/16/07, Fleisher, Ken wrote:
I have the following
code:
set
AppleScript's text item delimiters
to "."
repeat
with i from 1
to c1
set item
i of
names1 to text item 1 of item
i of
names1
end repeat
This will for example take the file name without the ".xxx"
extension for every file name in a list (I know there can be "."
elsewhere in the name, but for this purpose, our naming conventions do
not permit it.)
Is there some way to do this without the loop? For example, this does
not work:
set AppleScript's text item delimiters to
"."
set
names1 to text item 1 of every item of names1
Thanks in
advance!
You will need a sophisticated regular _expression_ engine, such as
the Satimage.osax. You would do:
set names1 to change "\\..*" into "" in
names1 with regexp
Emmanuel
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden
References: | |
| >Text items (From: "Fleisher, Ken" <email@hidden>) |