How to Send an iMessage From Command Line

By  on  

As somewhat of a recluse, believe me when I say that text messages, instant messenger, and iMessage have relieved me of loads of anxiety and wasted time with short, meaningless voice chat. It's been a decade since these communication types have become popular so we've moved on from appreciate these technologies to trying to optimize them.

My family and friends are deep into the Apple ecosystem so I frequently receive texts via iMessage (or Message on Mac); at the same time, I'm within a Mac terminal much of my day,. At this point, it's a bit of a hardship (poor me!) to even open the Messages app, and I'd prefer to send messages via command line.

To send a message via command line, you can type the following:

osascript -e 'tell application "Messages" to send "DWB and MooTools FTW!" to buddy "David Walsh"'

I'd recommend creating an alias for this command, which would accept a user and a message.

Command line wins are amazing time savers. Finding a way to accomplish tasks with your usual workflow will make you infinitely more efficient!

Recent Features

  • By
    Conquering Impostor Syndrome

    Two years ago I documented my struggles with Imposter Syndrome and the response was immense.  I received messages of support and commiseration from new web developers, veteran engineers, and even persons of all experience levels in other professions.  I've even caught myself reading the post...

  • By
    5 Awesome New Mozilla Technologies You’ve Never Heard Of

    My trip to Mozilla Summit 2013 was incredible.  I've spent so much time focusing on my project that I had lost sight of all of the great work Mozillians were putting out.  MozSummit provided the perfect reminder of how brilliant my colleagues are and how much...

Incredible Demos

  • By
    Chris Coyier’s Favorite CodePen Demos II

    Hey everyone! Before we get started, I just want to say it's damn hard to pick this few favorites on CodePen. Not because, as a co-founder of CodePen, I feel like a dad picking which kid he likes best (RUDE). But because there is just so...

  • By
    Create Twitter-Style Dropdowns Using MooTools

    Twitter does some great stuff with JavaScript. What I really appreciate about what they do is that there aren't any epic JS functionalities -- they're all simple touches. One of those simple touches is the "Login" dropdown on their homepage. I've taken...

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!