Re: Problem with extracting characters from a string
Re: Problem with extracting characters from a string
- Subject: Re: Problem with extracting characters from a string
- From: Matthew Smith <email@hidden>
- Date: Thu, 16 Dec 2004 21:41:40 +1100
on 16/12/2004 21:28, BADRINATH, NANDINI at email@hidden wrote:
> Have a problem with Applescripting. I have the filename which is
> stored as a string. How do I extract the filename as alphabets? Is there
> a way to access the array elements?
> E.g:- A string by name 'thefile' contains the name of the file. Let the
> name of the file be 'test'. How do I extract the filename as alphabets -
> i.e as 't','e','s','t' ? Is there any way to store the characters of
> filename
> in array?
set fileName to "myfilename"
every character of fileName
But you can also get each character of the string
character 1 of fileName
Or
set fileName to "myfilename"
set nameLength to length of fileName
repeat with i from 1 to nameLength
-- do something with the character
character i of fileName
end repeat
Not sure if this will solve the problem you were mentioning to me in a
private email.
--
Matthew Smith
_______________________________________________
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