ethan-wickstrom / macpymessenger

A Python Package for Interfacing with iMessage on MacOS
Apache License 2.0
3 stars 1 forks source link

Any interest in a utility to retrieve messages & images from the Messages app? #21

Open cyberchucktx opened 1 week ago

cyberchucktx commented 1 week ago

I've been digging around, and a friend wanted to have a way of retrieving messages from the Message app (only on OSX) in a date range, subject, or message source.

I've got something running now that allows for a date range for messages; it also downloads all images in the Messages app in a given date range. The destination of the download(s) can be specified.

I figured out the format(s) of the Sqlite database that underlies the Message app repository.

Anyone interested in this capability?

CyberchuckTX

ethan-wickstrom commented 1 week ago

@cyberchucktx Thanks for the suggestion! This feature would definitely boost macpymessenger's capabilities.

I'm interested, and your work on message retrieval and image downloading sounds great. A few questions:

  1. Are you planning to contribute this feature yourself? I'd love to collaborate!
  2. Can you share more about your current implementation? Any challenges or insights?
  3. What specific use cases are you or your friend targeting?
  4. Any preferences on how this should integrate with the existing API?

Privacy and Apple's guidelines should be considered to some degree as we explore this feature. Based on your feedback, we can discuss the next steps for possibly integrating this functionality.

cyberchucktx commented 1 week ago

Ethan:

@cyberchucktx Thanks for the suggestion! This feature would definitely boost macpymessenger's capabilities.

I'm interested, and your work on message retrieval and image downloading sounds great. A few questions:

Are you planning to contribute this feature yourself? I'd love to collaborate!Was planning on implementing it myself. Collaboration welcome ... wasn't sure if I should open my own repository or tag on to the existing one (macpymessenger).

Can you share more about your current implementation? Any challenges or insights?I'm targetting the search/retrieval of the existing iMessage threads, not sending texts out; yourpackage seems to be set up pretty well for that functionality.

I'm using the python API to sqlite3 directly and have figured out (with the help of online resources) howto query the tables to get my desired effect. The iMessage db is "chat.db" in a standardplace per user.

What specific use cases are you or your friend targeting?Specifically my friend does a lot of her correspondence(s) via text messages which often includes a set of images.

I plan to give her the capability of executing a Python script (or design a native UI with Python) that wouldlet her request messages with various parameters, like date range and/or sender information.  So, for example,she could ask for all messages from user X in the last week,and dump all the texts & images to a specified output directory.

Any preferences on how this should integrate with the existing API?Not sure if it needs to use the existing API, as all I'm doing is sqlite3 operations from Python.

Here's one of my major sources for this information:

Using SQL and Your Chat.db File to Look Through All of Your iMessages https://spin.atomicobject.com/search-imessage-sql/ From my brief look at your API I'm not sure how it would "fit". I note that you have a "chat_history" that isn't implemented yet.

I also note that you're using Applescript to talk to iMessage app.

I really like the sqlite3 direct access, although that could (probably will) change if Applechanges the database format (table names, etc). But as far as I can tell the chat.db format(s) have been pretty stable over the last few releases of the OS.

And the script could check for a specific OS and sqlite version.

Privacy and Apple's guidelines should be considered to some degree as we explore this > feature. Based on your feedback, we can discuss the next steps for possibly integrating this functionality.Agreed. But since this would be a local utility (running totally on the user's machine) would it needto worry about privacy or Apple guidelines?

I'm curious. Let's talk some more about this. I'm going to hack something together (already have inrough CLI script form) but may end up generating an app (maybe electron or some Python-based UIapp).  I have ZOOM & Google Meet and whatever to be able to discuss at your leisure.

This is a personal project that I thought might be of interest to you and your users.

Charlie aka CyberchuckTX

Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

cyberchucktx commented 1 week ago

Other interesting references / packages:

@cyberchucktx Thanks for the suggestion! This feature would definitely boost macpymessenger's capabilities.

I'm interested, and your work on message retrieval and image downloading sounds great. A few questions:

Privacy and Apple's guidelines should be considered to some degree as we explore this feature. Based on your feedback, we can discuss the next steps for possibly integrating this functionality.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>