Re: Looking for script that replaces last chars and replace it by .jpg
Re: Looking for script that replaces last chars and replace it by .jpg
- Subject: Re: Looking for script that replaces last chars and replace it by .jpg
- From: Emmanuel <email@hidden>
- Date: Fri, 16 Jan 2004 16:11:03 +0100
At 2:59 AM +0100 16/01/04, SVEN AERTS wrote:
>
Hi,
>
>
I have about 400 pics. that have too long names.
>
The .jpg drops and is necessary.
(I don't have a dog, so ...)
Use "text i thru j" to extract a substring. What is convenient is that you can use negative indices, for instance you would get the extension with "text -4 thru -1 of theName".
Then use the concatenation operator "&" to concatenate sub-strings.
Like:
--------------------
set theName to (text 1 thru 27 of theName) & (text -4 thru -1 of theName)
--------------------
If the extension's length is not fixed (e.g. you have jpg and you have jpeg), you've got to use "offset" to find out where exactly the "." is.
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.