otto is a imessage OSX chat handler. It runs in applescript with a golang parser.
imessage chat syntax:
otto COMMAND ARGS
(otto) (say) (that's cool!)
features:
- modular commands
- customizeable settings
- settings backup (if your settings file gets corrupted)
bugs:
- There is only 1 chat room stored, so data from other chats can show up
- Double messages - otto replies twice. This happens when you have unread messages in 1 chat, and otto is called in another.
set it up:
- clone this repo and give a star.
- change the
ottohandlerandsettings.jsonlocation 2x inside ofotto.applescript - move
otto.applescriptto~/Library/Application Scripts/com.apple.iChat - select
otto.applescriptas your imessage handler.
adding a function:
- create your function inside
library.go. Make sure it is one of these types:
func(string, string) stringcalls a function with message and from as argumentsfunc(string) stringcalls a function with message as the argumentfunc() stringcalls a function that returns a stringstringreturns a message
- add your function and it's keyword to
ottomapinsidelibrary.go - if your function takes arguments, make sure it handles edge cases including:
- no arguments called
- space is first character of argument
- incorrect arguments
DISCLAIMER:
- parts of
main.goandotto.applescriptwere taken from Jared. All credit goes to its owner.