Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text items




On 17 Jan 2007, at 01:03, some jumble-brain wrote:

Let's rerun the whole thing as I intended...

Sheesh. That didn't allow for adjustable truncation. Last time.

I'm off to bed. Tomorrow's another day... ;-)

-------------------

to strip_extensions from q to e
	script o
		property l : q
	end script
	set c to -1 - (count e)
	set tid to text item delimiters
	set text item delimiters to "."
	considering case
		repeat with i from 1 to count o's l
			tell text item 1 of o's l's item i to if it ends with e then
				set o's l's item i to text 1 thru c
			else
				set o's l's item i to it
			end if
		end repeat
	end considering
	set text item delimiters to tid
end strip_extensions

set names1 to {"231-001_M.tif", "231-001.tif", "231-001.jpg", "231-001-a_M.tif", "231-001-a.tif", "231-001-a.jpg"}

strip_extensions from names1 to "_M"

names1 --> {"231-001", "231-001", "231-001", "231-001-a", "231-001- a", "231-001-a"}

-------------------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: Text items (From: "Fleisher, Ken" <email@hidden>)
 >Re: Text items (From: kai <email@hidden>)
 >Re: Text items (From: kai <email@hidden>)
 >Re: Text items (From: kai <email@hidden>)
 >Re: Text items (From: Adam Bell <email@hidden>)
 >Re: Text items (From: kai <email@hidden>)
 >Re: Text items (From: kai <email@hidden>)
 >Re: Text items (From: kai <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.