Birthday Emails

Thank you for your input, but LaunchControl doesn’t NOT appear to be free; it looks like it costs $18 for a Personal License.

Am I misunderstanding something?

1 Like

As I understand, open location automatically encodes UTF-8 characters appropriately but Emoji characters are NOT encoded correctly by AppleScript per se.

I tried encoding the Emoji balloon character (“:balloon:”) using Online Text Tools and the character was simply ignored.

Apparently, Emoji encoding should be done via:

  • ASObjC
  • Shell command to Perl, Python (somewhat more involved since Apple no longer installs Python with macOS), etc.
  • JXA

Do you have any advice on which to choose?

I’ve never used either of these. My personal opinion is that the plist file format is simple enough that I’d just write my own (possibly looking at some created by other apps as references).

Plist files can be in XML format (where you can just rename a text file) or a binary format. Apple’s Xcode environment includes a general-purpose Plist editor which can work on either format. I’d recommend using the XML format, simply because it’s easier to maintain, but the Xcode editor may come in handy if you want to view plists created by other apps, which often use the binary format.

I’m afraid I can’t help here. I just looked up some useful articles and shared the links I found. I haven’t actually tried doing this.

Since you’re probably looking to just make one-time conversions (to create boilerplate text), I’d just try them all, starting from the easiest ones, until you find something that works for you.

Sorry, I had forgotten that I did pay $10 for it back in 2016. Comes with age, I guess.

Personally, I would not recommend creating a launchd plist file manually, even if duplicating and editing an existing one. I did this a few times early on in launchd’s history, and it works… but the launchd plist format can be inscrutable. It has so many options and potential keys you can use, that when looking for an existing plist file to copy you’ll find different developers achieving essentially the same thing in different ways. At the time, it was also poorly documented, which might still be the case! So for many years my preference has been to use Lingon X or LaunchControl as it’s much easier to see the options you can set, get explanations, and edit your launchd file in a structured way. Even when I duplicate an existing launchd plist file as a starting point, I use LaunchControl to edit it.

At first I used Lingon (I think it was the only option back then) but some years ago I switched to LaunchControl. I can’t remember why. I think both are good – they’ve got quite different approaches so it will mainly be a question of which style fits your way of thinking/working best. Both have free trials so you can play about a bit and see which suits.

BBEdit (which has a free ‘Lite’ version too) can also edit binary plist files. If you don’t have Xcode installed already, I would recommend this as it is more lightweight (quicker to load, responsive, and generally excellent as a text editor) and a much smaller download!

This thread offers many suggestions for encoding emoji characters.

Ultimately, I settled on using the percent encode handler within Shane Stanley’s RegexAndStuffLib v1.0.7 AppleScript Library. This and other useful libraries can be downloaded from Late Night Software’s freeware collection.

1 Like

I got my (first) AppleScript applet working. :partying_face:

Thank you to everyone who helped me along the way, including without limitation: @jzw @Shamino @alvarnell @angusC @jajvj1.

My script scans Contacts for people who have a birthday and/or wedding anniversary on the day it’s run and drafts a simple email greeting in the default mailer—mine is the web interface to Gmail—that can be edited prior to sending (manually). I’ve included code to automatically send greetings by SMS if a suitably labeled email address isn’t available. But I commented out the actual SMS sending because I’m not comfortable letting any greeting go out automatically without a manual review.

It’s reasonably well documented and includes switches for some limited logging and tracing.

My early versions ran in less than 3 seconds. After taking a close look at my Contacts, however, I added some unnecessary data checking and logging to help me identify cleanup opportunities; now it takes about 7 seconds to run through my 6K of Contacts on my ancient iMac (late 2015?).

Please private message me if you’d like a copy of the script file to play with and make your own.

For the lawyers …