• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem with extracting characters from a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Problem with extracting characters from a string (From: "BADRINATH, NANDINI" <email@hidden>)

  • Prev by Date: Re: Problem with extracting characters from a string
  • Next by Date: Re: Delay x return, how reliable, fast or slow is AppleScript?
  • Previous by thread: Problem with extracting characters from a string
  • Next by thread: Re: Problem with extracting characters from a string
  • Index(es):
    • Date
    • Thread