I'm always looking for new ways to develop code.
My latest adventure was writing a script to update contact photos on iOS for a prettier experience in the Messages app conversation list.
The script is called
The idea is:
There are various conditions where Apple iOS can't (or won't) synchronize Contact photos between iPhone/iPad devices. If you're in this situation and want it to "just work", you can configure each device manually. Or you can run this script to do that for you.
update-ios-contact-images.jstakes a list of email addresses and optional image links and sets the photo for matching contacts in your address book. If an image link is provided, it's used as-is; if not, the Gravatar for that email address is used instead.
You can find more in the update-ios-contact-images.js repository on Github, but the code is short enough that I've included it below.
- As I said on Twitter, this was the first meaningful programming project I did completely on iPad (and iPhone). Research, prototyping, coding, debugging, documentation, and posting to GitHub were all done on an iOS device (using a Bluetooth keyboard at times). The overall workflow has some rough edges, but many of the pieces are there today to do real-world development tasks.
asyncfunction is not obvious to me). However, the lack of support for "parallelism" by
awaitmeans you still need to know about Promises and be comfortable using helpers like Promise.all (so I wonder how much of a leaky abstraction this ends up being).