Skip to content

Instantly share code, notes, and snippets.

@bencharb
Last active July 17, 2017 06:07
Show Gist options
  • Save bencharb/b736603a18177feccd69c09e9515a14f to your computer and use it in GitHub Desktop.
Save bencharb/b736603a18177feccd69c09e9515a14f to your computer and use it in GitHub Desktop.
Apple Messages query messages from person
/*
QUERY Apple Messages sqlite database
at ~/Library/Messages/chat.db
*/
select
datetime(m.date + strftime('%s','2001-01-01'), 'unixepoch', 'localtime') as dt
, m.text
, c.chat_identifier
from
message as m
, chat AS c
JOIN
chat_message_join cmj ON
cmj.message_id = m.ROWID
AND cmj.chat_id = c.ROWID
WHERE
m.is_from_me = 0
AND
c.chat_identifier = "+15555555555"
--AND m.text LIKE '%ok%'
order by m.date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment