我有 Mac OS X Mountain Lion (10.8.x),虽然我很欣赏通过 GUI 提供的“消息”功能,但我正在尝试找到一种通过命令行向另一个人的手机发送 iMessage 的方法。有谁知道如何做到这一点?
我不希望使用“打开 Messages.app”来操纵脚本,但如果这是目前唯一可行的方法,请尊重。
osascript -e 'tell application "Messages" to send "Hello World" to buddy "(your buddy name)"'
我找到了一个简单的方法来做到这一点。如果您安装了 brew,只需运行“brew install iMessage”。然后运行“iMessage -t yourmessage -c contact@email.com”。
I don't think it's possible the apple developer site doesn't mention that and probably it's because they don't want to give opportunity to programmatically send messages (i think spambots are a concern) because it could be potentially annoying to receive automated messages but you could use notifications that it's specifically thinked to do what you are asking