• 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: Textstring as List behaviour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Textstring as List behaviour


  • Subject: Re: Textstring as List behaviour
  • From: "J. Stewart" <email@hidden>
  • Date: Sat, 25 Nov 2006 04:16:45 -0500

On 11/25/06 at +0100 Ronald Hofmann said this

>set AppleScript's text item delimiters to {","}
>set theList to words of "11250044.jpg,11250045.jpg,11250046.jpg,
>11250047.jpg,11250048.jpg" as list
>set the text item delimiters to ""
>
>I exspected to get this:
>{"11250044.jpg", "11250045.jpg", "11250046.jpg", "11250047.jpg",
>"11250048.jpg"}
>
>But what I get is this:
>{"11250044", "jpg", "11250045", "jpg", "11250046", "jpg", "11250047",
>"jpg", "11250048", "jpg"}
>
>I don“t understand this behaviour. I thougt setting the delimiter to
>comma splits the string at the comma.
>
>What am I doing wrong?
>Any hints?


You are asking for 'words' instead of 'text items' and a period is a 'word' boundary. Try this instead ->

--> Cut <--
set theList to "11250044.jpg,11250045.jpg,11250046.jpg,11250047.jpg,11250048.jpg"

set my text item delimiters to {","}
set theList to every text item of theList
set my text item delimiters to ""
--> Cut <--

JBS
--
Everyone has a photographic memory; Some just don't have film.
 _______________________________________________
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: 
 >Textstring as List behaviour (From: Ronald Hofmann <email@hidden>)

  • Prev by Date: Re: Textstring as List behaviour
  • Next by Date: Fwd: scripting Mail.app forwarding spams
  • Previous by thread: Re: Textstring as List behaviour
  • Next by thread: Fwd: scripting Mail.app forwarding spams
  • Index(es):
    • Date
    • Thread