• 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: Looping through a list question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looping through a list question...


  • Subject: Re: Looping through a list question...
  • From: Paul Skinner <email@hidden>
  • Date: Mon, 4 Nov 2002 17:45:06 -0500

On Monday, November 4, 2002, at 05:24 PM, Gregory Smith wrote:

Hello Everyone,

Okay, I know this will probably be a dumb one on my part, but why can't I
loop through a list with only one item with out the looping 'seeing' the
single var as a list of text items???
snip
Cheers,
Greg

Hiku answer...

scripts worked yesterday
today, they are all broken
silent coercions!

Applescript will try to coerce a single item list to it's contents. You need to make sure that it gets treated as a list.

set l to {"a ha, thats it!"}
repeat with thisItem in l as list
say thisitem
end
--
Paul Skinner

Perhaps if AS had a shabang statement so at the top you could just...

#! use noisy coercions;
_______________________________________________
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.

References: 
 >Looping through a list question... (From: "Gregory Smith" <email@hidden>)

  • Prev by Date: Save from Photoshop as GIF with transparency?
  • Next by Date: Re: iCal scripting samples
  • Previous by thread: Looping through a list question...
  • Next by thread: Re: Looping through a list question...
  • Index(es):
    • Date
    • Thread