by RoseO · 12y ago · 0 comments
It's probably not possible to do this in pure Node but if it's of interest here is the gist: https://gist.github.com/roldershaw/7311547
Now I can see iMessage chatbots being made :P
The gist version should even be able to handle input from stdin: https://gist.github.com/aktau/8958054
Like this: ./imessage <number> < notes.txt
I use it quite often :). The most difficult thing to me was getting it to work even when Messages.app wasn't started. Applescript is quite frustrating for someone who's never dealt with it before. This was on Mavericks though, not sure if that's still a problem on Yosemite. Does your version have problems with that?
I don't use this anymore because I've ditched my iPhone.
EDIT: ...which appears to be a simple wrapper around osascript.
[1]: https://developer.apple.com/library/mac/releasenotes/Interap...