Skype stores its chat history in a SQLite database: ~/Library/Application Support/Skype/YourSkypeName/main.db
. You can use the command line sqlite3
tool to view the chat logs.
Find out user names of your chat partners
The following command in Terminal (I'm assuming you're using the bash
shell) lists all your chat partners' user names:
sqlite3 /Users/danielbeck/Library/Application\ Support/Skype/YourSkypeName/main.db 'SELECT DISTINCT(dialog_partner) FROM Messages;'
Extract all messages to and from a specific chat partner
Option A. Write to terminal
To print all messages to and from a certain chat partner (theOtherPersonsUserName
), use the following command:
sqlite3 /Users/danielbeck/Library/Application\ Support/Skype/YourSkypeName/main.db "SELECT author, from_dispname, datetime(timestamp, 'unixepoch') as date, body_xml FROM Messages where dialog_partner = 'theOtherPersonsUserName' ORDER BY timestamp;"
This will print one message per line, chronologically, with sending username, display name, date, and text, like the following:
danielbecks-username|Daniel Beck|2012-02-03 08:47:53|Just testing something
Option B. Write to file
You can write this chat log directly to a file. Run the following to write the log with theOtherPersonsUserName
to the file theOtherPersonsUserName.log
:
sqlite3 /Users/danielbeck/Library/Application\ Support/Skype/YourSkypeName/main.db "SELECT author, from_dispname, datetime(timestamp, 'unixepoch') as date, body_xml FROM Messages where dialog_partner = 'theOtherPersonsUserName' ORDER BY timestamp;" > "theOtherPersonsUserName.log"
Of course, you can also open main.db
in any SQLite database viewer and go from there.