Re: Creating a list of numbers from a Contacts group
Re: Creating a list of numbers from a Contacts group
- Subject: Re: Creating a list of numbers from a Contacts group
- From: Stan Cleveland <email@hidden>
- Date: Thu, 05 Jan 2017 12:37:10 -0800
On Jan 5, 2017, at 11:50 AM, Steve Mills <email@hidden> wrote:I really wish there was a way to filter lists directly in AppleScript. Like why can't this work:set blah to {"one","","two"} set blah to every item of blah where it is not "" -->{"one","two"}
That would make this script so much shorter. Hi Steve,
use script "List"
set blah to {"one", "", "two"} set nonNullItems to filter list blah using isNotNullString --> {"one", "two"}
script isNotNullString to filterItem(aValue) return aValue is not "" end filterItem end script
Using a script object to define the filter is a unique approach and does add a few lines of code, but it's reusable and kept out of the way, much like a handler or subroutine.
My "wish" is that Apple would include has's libraries as part of the standard OS X installation. They are really quite nice and add valuable capabilities to the AS toolbox.
Regards, Stan C.
|
_______________________________________________
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