ezhes / OSXMessageProxy

An API for OSX's Messages app which provides full iMessage capabilities!
MIT License
84 stars 13 forks source link

Question: Why UI Automation in Applescript? Also, what about HTTP callbacks in Applescript? #32

Closed cworsley4 closed 5 years ago

cworsley4 commented 5 years ago

So I've had the same issue with no feedback from Applescript when sending iMessages. One idea I had for that is to add a script in Messages (see the Messages preferences screen) that would post back or communicate over some protocol that a message or event has finished. Just a thought.

Also, what exactly is the advantage of using UIAutomation? I haven't heard of that before. I'm doing this here like you are: https://github.com/shusain93/OSXMessageProxy/blob/76118c2c177ab7b01e5ae4e854ee10d8ea92af98/MessageProxy/messageSender.applescript#L7-L11

But was curious why you take this approach? Is it faster? More reliable? https://github.com/shusain93/OSXMessageProxy/blob/76118c2c177ab7b01e5ae4e854ee10d8ea92af98/MessageProxy/messageSender.applescript#L15-L31

ezhes commented 5 years ago

This lets you send messages to named group chats. It's a horrible hack but it's necessary. The server app sets usingUIAutomation if it thinks it can use what it calls fast message sending (single recipient) but otherwise it uses the safer UI event injection.