Show HN: Extract iMessage Attachments and Links into Organized Folders
gist.github.comI 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!
If you want something a bit more robust and cross-platform, including support for the undocumented TypedStream-stored text data, you can use my open source software: https://github.com/ReagentX/imessage-exporter
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?
I was unable to access this via iTerm and had to find instructions to allow iTerm to access this folder. This URL helped and then the utility worked great. Thank you for this, this is so handy.
https://stackoverflow.com/questions/54581085/library-message...
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.
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 !