Skip to content Skip to sidebar Skip to footer

How Do I Get (people Whose Id Of Addresses Contains Addressid) In Jxa?

I’m using JavaScript with osascript, on MacOS Mojave 10.14.3, to write a script that displays people and their contact information from Contacts. I’m adding a function to show

Solution 1:

Maybe something more like…

const contacts = Application('Contacts').people,
    matchingAddresses = contacts.addresses.whose({city: "San Diego"}),
    addressIds = matchingAddresses().filter(a=>a.length).map(a=>a[0].id());

addressIds[0]; // the first id

Or if you want the address…

const contacts = Application('Contacts').people,
    address = contacts.addresses.whose({city: "San Diego"})().filter(a=>a.length)[0]

address

Post a Comment for "How Do I Get (people Whose Id Of Addresses Contains Addressid) In Jxa?"