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
ottohandler
andsettings.json
location 2x inside ofotto.applescript
- move
otto.applescript
to~/Library/Application Scripts/com.apple.iChat
- select
otto.applescript
as your imessage handler.
adding a function:
- create your function inside
library.go
. Make sure it is one of these types:
func(string, string) string
calls a function with message and from as argumentsfunc(string) string
calls a function with message as the argumentfunc() string
calls a function that returns a stringstring
returns a message
- add your function and it's keyword to
ottomap
insidelibrary.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.go
andotto.applescript
were taken from Jared. All credit goes to its owner.