Skip to content

Instantly share code, notes, and snippets.

@Gnitset
Forked from tk512/MessageReceive.script
Created March 21, 2019 10:08
Show Gist options
  • Save Gnitset/943ee5133c1fbb266522b14e333f6010 to your computer and use it in GitHub Desktop.
Save Gnitset/943ee5133c1fbb266522b14e333f6010 to your computer and use it in GitHub Desktop.
# Event handler
using terms from application "Messages"
on message received theText from theBuddy for theChat
set quoted_message to quoted form of theText
set quoted_id to quoted form of (id of theBuddy as text)
do shell script "echo " & quoted_message & " | ~/bin/MessageReceive.sh " & quoted_id & " > /dev/null 2>&1 &"
# make messages happy
return true
end message received
on message sent theMessage for theChat
end message sent
on active chat message received
end active chat message received
on chat room message received theMessage from theBuddy for theChat
end chat room message received
on addressed chat room message received theMessage from theBuddy for theChat
end addressed chat room message received
on addressed message received theMessage from theBuddy for theChat
end addressed message received
on av chat started
end av chat started
on av chat ended
end av chat ended
on login finished for theService
end login finished
on logout finished for theService
end logout finished
on buddy became available theBuddy
end buddy became available
on buddy became unavailable theBuddy
end buddy became unavailable
on completed file transfer
end completed file transfer
end using terms from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment