Re: List filtering - help
Re: List filtering - help
- Subject: Re: List filtering - help
- From: Malcolm Fitzgerald <email@hidden>
- Date: Wed, 16 May 2007 06:51:39 +1000
On 16/05/2007, at 3:49 AM, Patrik B. wrote:
Hi Malcolm,
Thanks for the tip on offset. I tried it and in theory it works.
However I
forgot to mention another part of my script.
I basically dump all file names that are in a certain folder into a
list.
So my list becomes filenames lets say "GO", "SMO", "TOE", "GER",
"FRE", "ITA"
I then want to check if GER appears in the list and if not have its
name
thrown back at me.
if I use the repeat through each item then I get the file thrown back
at me 5
times as it does not appear 5 times. But I want to know if it exists
as a
single entity so to speak in the list at all and based on that throw
the name
back at me.
-- one way is to ignore duplicates
set end of l to newItem unless l contains newItem
-- another way is to exit the loop when you get a result
if "abc" contains "g" then exit repeat
-- or, only proceed if the conditions are right
repeat with newItem in {"a",3,"g"}
set x to class of newItem is not text -- or whatever test it takes
if x then
-- do something
end
end
malcolm
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden