19

I have a 5-year conversation going on with my wife on iMessage.

Every once in a while I want to find something like a restaurant she messaged me about.

I want to search for the word "restaurant" and find ALL the times she used that word, meaning only within HER messages.

How can I do that?

I know about the universal iMessage search, but that's not what I'm after. It shows me only 1 instance of the word "restaurant," not all of them.

1
  • 2
    I wish.... I've sent that suggestion to apple.com/feedback before, you should also.
    – Tyson
    Commented Feb 26, 2017 at 1:01

5 Answers 5

9

The archive of all the messages is in ~/Library/Messages/chat.db. It's a SQLite database. There are some SQLite viewers that will make it fairly easy to sort this data and either allow you to search it or selectively export some of it to CSV. A good example would be https://sqlitebrowser.org/ which is free and open source, it also allows for CVS export so you can open it as a spreadsheet.

Alternately if you search for "sqlite to csv" you'll find some more information on exporting it. Unfortunately this is a big weakness of iMessage.

3
  • 1
    Should get more upvotes. This isn’t a bad solution, intact it’s a very good one. Commented Jun 16, 2018 at 20:25
  • 1
    I would just edit and add a viewer that does this. Commented Jun 16, 2018 at 20:26
  • @user7886229 good call, added a link to a good SQLite tool. Commented Feb 28 at 15:28
6
  1. Open Messages on Mac
  2. Type term into search bar (also accessible using CMD+F)
  3. Click on the desired conversation you want to search in
  4. You'll see the first message (chronologically) that contained the word displayed in a faded color
  5. Press CMD+G to see the next occurrence and shift+CMD+G to see the previous one.

--

Keyboard shortcuts are shown in the menubar: Edit → Find

This functionality should work across most apps, not just Messages.

10
  • 4
    This search functionality is very hit or miss and generally not reliable or effective. Also I'm pretty sure the original poster said this wasn't effective. Commented Mar 9, 2018 at 20:22
  • I respectfully disagree with both of your statements. Can you expand on your perceived lack of reliability/effectiveness?
    – JBallin
    Commented Mar 12, 2018 at 2:51
  • I just tried searching for the words "Crash pad" that are in an iMessage from my dad dated 2 days ago. iMessage says "No results found" and a search for just the word "Crash" gives tons of results except for the message from my Dad. Not sure how much worse you can be at search than that. Commented Apr 3, 2018 at 18:25
  • 1
    Tried quitting repeatedly, changing caps, adding quotes, nothing works. Commented Apr 4, 2018 at 23:41
  • 3
    I agree. Search feature on this message app does really suck
    – Fabien
    Commented Mar 12, 2019 at 11:13
4

This was asked a long time ago, but Apple still didn't do anything to make the search in Messages easier or more reliable, and I just faced this problem myself today.

The best solution I have found is to use Chatology for Mac. It is a paid app (with a 14-days trial), but does the job perfectly:

  • it allows you to search through entire single conversations,
  • it searches for word-substrings, not just whole words,
  • it ignores diacritics
  • it has (optional) integration with native Messages app, so hitting CMD+F in Messages will automatically open Chatology for you.

Lastly, it allows you to export entire conversations as text files, so you can search them manually or do whatever you need to do with them.

You can download the trial or buy the app here: https://flexibits.com/chatology.

Note: I am not related to developers of the app in any way.

1

Edit => Find => Find Next & Edit => Find => Find Previous are greyed out for me so those approaches aren't options.

I simply opened the conversation in a separate window and kept scrolling up rapidly to load all of the old chats.

You can press command + A to select the entire chat, press command + C to copy it to the clipboard, and then paste the chat in TextEdit (or another text editor). Any text editor will provide better search support than iMessage - just press command + F.

1

If you have a Mac:
Open Terminal.

Browse to your Messages directory. Replace 'jimmy' with your username. If not sure, browse to the Users directory first to confirm what it is.
cd /Users/jimmy/Library/Messages

Next run a program that allows you to interact with the database containing your chat messages: sqlite3 chat.db

sqlite program opens and gives you its own command prompt. Enter the following replacing the number with the number of the contact you want to search on. Actual contact names like 'Jill' are not stored in the db, so you have to use their phone number (if that doesn't work, maybe try their email if that's all you have for the contact. Replace the example text, Apple, with your own keyword or phrase. Leave the % signs as they tell the program to search for the word or phrase at any location within the message like so:
select text from message join handle on message.handle_id = handle.ROWID where handle.id = '+19344968775' and message.text like '%apples%';

If you got the phone number right and there are results for your search you will see the content of the text on the next line, like so:
Please buy apples

To exit:
sqlite> .exit

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .