On Jun 09, 2016, at 21:52, Jim Underwood <email@hidden> wrote:
Maybe I missed it (after much searching), but I haven't found a good, generic, handler to filter lists, using native AppleScript.
______________________________________________________________________
Many have been written over the years.
Your handler looks pretty good.
Yvan's method of transforming a list in place works well.
Another handy tool is to use filter-forms that list-objects do understand.
-------------------------------------------------------------------------------------------
set the name_list to {"Rob", "Sal", "Wanda", "Sue", "Robert"}
repeat with i in name_list if i contains "rob" then set contents of i to 0 end repeat
set name_list to text of name_list
name_list
-------------------------------------------------------------------------------------------
set the name_list to {"Rob", "Sal", "Wanda", "Sue", "Robert", 1, 2, 3, 1.5, 2.7, {x:"Xval", y:"yVal"}}
text of name_list reals of name_list integers of name_list records of name_list
-------------------------------------------------------------------------------------------
|