

Show HN: I made a command-line iMessage interface - camhenlin
https://github.com/CamHenlin/imessageclient

======
striking
Please note that this isn't actually using the iMessage protocol, this just
uses AppleScript to fire messages via Messages.app. However, it's nice to
finally be able to iMessage over SSH. :)

~~~
zer0defex
Agreed! I'm definitely going to lift some of this code for some Alfred
workflows too.

~~~
camhenlin
Please post it, I'd love to see what you come up with!

------
jmduke
_## Why did you make this?_

 _Why not?_

Regardless of the actual repository (though don't get me wrong, this is still
super cool and I like seeing AppleScript in action since I feel like it's
criminally underused), this kind of thing in a Readme always brings a grin to
my face. Tinkering for tinkering's sake is the best.

~~~
pwenzel
"Why not?" is fine, but my question is:

What are you going to use it for?

~~~
ZoF
I'd say using iMessage over ssh. What makes your question more valid than 'why
make this'?

------
justinmayer
For those of you who, like me, might want to use this on older hardware, I got
an error on launch on Mac OS X 10.8.5 Mountain Lion:
[https://github.com/CamHenlin/imessageclient/issues/2](https://github.com/CamHenlin/imessageclient/issues/2)

Just thought I'd mention it here in case others are thinking of trying this
out on Mountain Lion.

 _Edit:_ CamHenlin has already committed a fix for this problem. Nice work!

~~~
camhenlin
Thanks, hoping that I can help you out!

------
adieth
If it could be ingrated with [WeeChat] [1], it could be a way to provide
iMessage support as a [web browser chat client] [2] and to [Android devices]
[3].

[1]: [https://weechat.org/](https://weechat.org/) [2]:
[https://github.com/glowing-bear/glowing-bear](https://github.com/glowing-
bear/glowing-bear) [3]: [https://github.com/ubergeek42/weechat-
android](https://github.com/ubergeek42/weechat-android)

~~~
dewey
It's "just" using AppleScript for some GUI scripting, it's still using the
Messages.app. Still a pretty cool project.

------
omaranto
I know I'll sound like I am an old man yelling "Get off my lawn!", but as far
as I can tell this is a text-mode application but it is _not_ a commandline
interface. Note that it's only the HN submission title that gets it wrong, the
Readme.md on GitHub correctly calls it "terminal-based" rather than CLI.

An actual commandline interface would also be cool, to be able to easily send
iMessages from shell scripts, for example.

~~~
camhenlin
Sure, you're right, I just got excited typing out the title :) You could
actually use the AppleScript files in the repo to send messages directly
without the use of the rest of the code. Usage would be like this:

osascript sendmessage_single.AppleScript PHONE_NUMBER_OR_ICLOUD_EMAIL "my
message text" false false

------
BillinghamJ
Have you looked into using MessagesKit.framework? (In
/System/Library/PrivateFrameworks)

If it's written in Obj-C, you can extract fully usable headers from it. If
C++/C/etc., it will be difficult (but not impossible) to understand it.

After extracting the headers from that, you may well be able to use it instead
of AppleScript.

~~~
camhenlin
Thanks for the pointer, exactly the type of response I was hoping to elicit

------
lindbergh
Really cool. Now I must figure a way to add this as an emacs mode. Good job!

~~~
camhenlin
How about a Sublime plugin :)

------
asdf0
ive played with this similar before capturing incoming. as well you can write
events for messsages in javascript just now with yosemite the same as you
would applescript. you can use osacompile and osascript command tools to run
and compile javascript/applescript. the same things applescript can do. i find
easier to write. doesnt have to be complicated to run for personal use inside
ssh.

~~~
rjuyal
Did you tried capturing incoming messages? If yes, please redirect me how to
do so.

------
blogle
This is amazing, I have been wanting something like this for some time now.
Hopefully the protocol can be demystified such that this is less clumsy.

~~~
gargarplex
This has the potential to be some day disruptive to Twilio, Plivo, etc.

------
LargeCompanies
ANyone know of way or an app to search your iMessage threads?

~~~
xuki
[https://flexibits.com/chatology](https://flexibits.com/chatology)

This looks solid

------
akrymski
Awesome! Is there a way to create a new conversation?

~~~
camhenlin
Hi, just wanted to let you know that I added new conversation functionality!

~~~
akrymski
Great thanks!

------
alexose
Cool project! Though, the OSX requirement makes its utility pretty limited.

Could someone host iMessage as a service without being sued into oblivion?

~~~
camhenlin
Hi, op here, I'm actually working on a hosted solution right now making use of
a set of physical Macs and fast user switching. Hoping to have something to
show for it in the next several weeks!

~~~
ianlevesque
I think this is one of those projects we all think about doing, then realize
an Apple ID is way too critical to a Mac / iPhone user's security (remote wipe
anyone?) to let a third party authenticate with it.

It would be really handy as something I could run on my own mac.

~~~
camhenlin
Yeah, the service will essentially be a man in the middle on the account, and
I believe it will be very important to communicate that with users. I'll think
about releasing a standalone "server" app based on the code although I've
already built something somewhat similar (although even "clunkier" if you can
imagine that) here:
[https://github.com/CamHenlin/imessageservice](https://github.com/CamHenlin/imessageservice)

~~~
jsmthrowaway
> Yeah, the service will essentially be a man in the middle on the account,
> and I believe it will be very important to communicate that with users.

No, it will be very important not to do it, because you are knowingly busting
security open on Apple IDs with your service and think that educating users is
the best way to mitigate that. We all know most of your users won't know any
better. The better way to mitigate it is to _not_ accept Apple IDs in the
first place.

If you launch that service, I would feel obligated to tip off the iCloud folks
that you're knowingly compromising Apple IDs. That isn't because I want to see
you fail, but because you are compromising Apple IDs and your users are caught
in the middle.

This is an idea you should let go. I know that sucks to hear.

~~~
jsjohnst
I generally hate posts that are just a +1 to something, but I feel your point
is important enough that it needs echoing. I as well will do the same as you
if I see a service like this.

------
vhost-
macmini-server-in-a-closet = iMessage on linux over ssh.

I should label it "iMessage server".

------
djabatt
Yeah why not?

------
justinmk
Anyone know of a CLI client for Microsoft lync?

~~~
Macuyiko
Yup. Pidgin + SIPE
[http://sourceforge.net/projects/sipe/](http://sourceforge.net/projects/sipe/)
\+ Finch [http://linuxers.org/article/finch-command-line-
alternative-p...](http://linuxers.org/article/finch-command-line-alternative-
pidgin)

------
rian
Bitlbee!!

