Show HN: Extract iMessage Attachments and Links into Organized Folders

gist.github.com

27 points by somefries 9 days ago

I created a simple shell (zsh) script to help macOS users extract attachments (photos, videos, audio files) and URLs from their iMessages. The script pulls data directly from the Messages database (chat.db), organizes attachments into folders named after each contact or group conversation, and compiles all shared links into CSV files.

This tool can be useful for anyone looking to back up or organize files shared over iMessage without needing the entire conversation history. It also handles macOS's complex local storage structure for attachments.

No sign-ups or dependencies beyond macOS and SQLite. Just run the script, and it’ll create a neat export folder on your desktop. Would love feedback on any edge cases you encounter!

johng 9 days ago

Suggestion: The folders are the phone number. Is it possible to use the contact name for the folder name instead of the number, if it is a known contact/in the address book? Also, what about .heic support?

ata_aman 9 days ago

Awesome, thanks for this. Thinking of doing the same for Mail?

I was using a DB product to extract iMessages for years and I lost it when I got a new Mac, this is perfect.

  • somefries 9 days ago

    Not yet! Great idea though. I've always just pulled out my conversations without pulling the attachments or URLs. The next version might provide an option for what you want to extract (Messages, Attachments, URLS)

    I'll mess with Mail after that!

    Thanks for the love @ata_aman !