MacOS – How to get iMessages from receiver on OS X Mavericks

macosmessages

By imessage, I can send and get message from another Apple ID. Message history is storing in /Users/username/Library/Containers/com.apple.iChat/Data/Library/Messages (on my mac)

In that directory, there are Archive and attachments (alias). I can see all my messages and my receiver's messages.

I wonder whether I get the messages from my receiver by specific language like php, javascript, or other thing else ? How can I get those messages ?

Best Answer

I couldn't figure out how to see only messages sent by other people, but you can see the text of all messages (and some other strings) by running:

for f in ~/Library/Containers/com.apple.iChat/Data/Library/Messages/Archive/*/*.ichat;do plutil -convert xml1 "$f" -o -|ruby -rplist -e 'puts Plist.parse_xml(STDIN.read)["$objects"].select{|x|x.is_a?(Hash)&&x["NS.string"]}.map{|x|x["NS.string"]}';done

sudo gem install plist installs the plist gem.