New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS High Sierra missing apple script handler from messages.app #20

Open
mezeipetister opened this Issue Apr 15, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@mezeipetister

mezeipetister commented Apr 15, 2018

Hi Guys,

It's Peter Mezei, and just wanted to try out your Bot, but stack with messages.app.
It looks like Apple has recently removed the possibility to set custom script handling functionality from its apps - like from messages app.

Do you have any idea how to solve this issue?

@ZekeSnider

This comment has been minimized.

Owner

ZekeSnider commented Apr 15, 2018

Hi,

Thanks for letting me know. I hadn't noticed this before, but apparently (much to my dismay) Apple quietly removed this in 10.13.4. More info here.

I tried editing the plist directly (~/Library/Containers/com.apple.soagent/Data/Library/Preferences/com.apple.messageshelper.AlertsController.plist and ~/Library/Preferences/com.apple.iChat.plist) to see if it was just removed from the UI, but I haven't had any luck so far. Unfortunately, if there's no workaround using the plists, this may be the end of the road for Jared. It'll still work on 10.13.3 and earlier, but that just makes it more inconvenient to run.

@mezeipetister

This comment has been minimized.

mezeipetister commented Apr 15, 2018

But for now, as I see there is no way to create chatbot for iMessage? I am looking for any possible solution to create a custom chatbot for iMessage.

@ZekeSnider

This comment has been minimized.

Owner

ZekeSnider commented Apr 15, 2018

There is no way with this functionality removed. I don't think anybody has managed to reverse engineer the private iMessage APIs. If you need an iMessage chatbot working, easiest way would be to downgrade your macOS version currently.

@mezeipetister

This comment has been minimized.

mezeipetister commented Apr 15, 2018

Thank you!

@mezeipetister

This comment has been minimized.

mezeipetister commented Apr 18, 2018

I have found an ugly way to solve it. Access messages through its sqlite database.
In this way I can write a workaround that runs as a while true loop, watching the new messages and once its the right one it can reply to message.

SQLite part:
set result to do shell script (["sqlite3 -line ~/Library/Messages/chat.db ", ¬
"'SELECT MAX(date) lastMessageDate, h.id, text, m.ROWID ", ¬
"FROM message m INNER JOIN handle h ON h.ROWID=m.handle_id ", ¬
"WHERE 'm.ROWID' > " & rowIdNow & " GROUP BY h.ROWID' | egrep -io -e '\w+ = .+'"] as text)

@ZekeSnider

This comment has been minimized.

Owner

ZekeSnider commented Apr 19, 2018

Thanks for the idea, that looks like it'll be a serviceable workaround. Not pretty, but I don't think there's another option... I've looked at the db before but hadn't thought of watching it on loop.

I'm going to try to get Jared updated using this method, will update this issue as it progresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment