Py IMessenger Save

Py-iMessenger is a chatbot that works with iMessage to execute commands using text messages.

Project README

Py-iMessenger

Py-iMessenger is a chatbot that works with iMessage to execute commands using text messages. Home Page

Important

It appears that after upgrading to MacOS Monetery, Py-iMessenger has lost the ability to send files (images, videos, etc.) using Applescript. You can check out the problem here. With the newest commit, Py-iMessenger will check to see the MacOS version and will use GUI programming to actually open the Messages app, paste the file, and send it. This decreases performance signficantly and does not work all of the time.

Py-iMessenger is completely broken with MacOS Ventura. As far as I can tell, the database is no longer being updated with messages and frankly I've lost the energy to continue with this project. As of 06/05/23 I have tried accessing the iMessage DB as it shows that is updating but when trying to view the messages some appear as NULL until the entire database itself is copied and pasted elsewhere.

About

Py-iMessenger is a simple chatbot that is powered by Python and Applescript. By reading from the iMessage database on MacOS devices, Py-iMessenger allows developers to create extensions that can do various tasks such as sending files, pulling up the recent news, or adding to a todo list. These extensions can be accessed by users simply through texting.

Py-iMessenger's frontend design takes inspiration from Zeke Snider's Jared, however the backend was written by myself in Python.

Py-iMessenger also supports the ability to send text messages to a iMessage groupchat. When added to a groupchat, all users except the host device will be able to run commands that send texts, image sending is not availible.

Installation

The following steps show how to get Py-iMessenger up and running.

Be advised, Py-iMessenger is only compatible with MacOS devices which support iMessage, iMessage must be enabled to for the program to run. Running this program on a Windows or Linux device will result in an error message. Furthermore, the program has only been tested with Python3.9

  1. Begin by cloning or downloading the .zip file to your MacOS device
  2. Change directory into the cloned/downloaded folder
cd PATH/TO/FOLDER/Py-iMessenger
  1. Create a virtual environment within the folder
python3 -m venv venv
  1. Activate the virtual environment
source venv/bin/activate
  1. Install all the dependencies necessary for Py-iMessenger
pip3 install -r requirements.txt
  1. Run the program
python3 main.py
  • If you see an error that means that either the terminal or your IDE do not have "Full Disk Access", to remedy this click on the Apple logo on the top left of your screen, click "System Preferences", select "Security & Privacy", use the scroll bar on the left to find and click "Full Disk Access", select the lock icon at the bottom to allow changes and give full disk access to your terminal or IDE.

Disk Perms

  • The program you are using to run the program (terminal/IDE) may also ask you for permissions to control the Messages app, allow this.

Message Perms

Usage

Py-iMessenger supports sending both messages and files:

Messenger Demo

This demonstration is accurate for all MacOS versions prior to Monterey.

Technologies

  • AppleScript - Used to control iMessage
  • SQLite3 - Used to read the iMessage database
  • PyQt5 - Used to create frontened

Helpful Tips

When Py-iMessenger runs for the first time, all user data will be automatically loaded into src/backend/user/savedUser.json along with a couple other config files for things such as API keys and the settings UI, to stop these config files from showing up when doing "git status", it would be wise to run the following commands in the project directory:

> git update-index --skip-worktree src/backend/user/savedUser.json
> git update-index --skip-worktree src/backend/plugins/config.ini
> git update-index --skip-worktree src/frontend/settings/configUi.ini

Documentation

Documentation regarding how the program works, how to create an extension, and how to use the multitude of features that Py-iMessenger gives to develops, check out the YouTube playlist

Acknowledgments

A special thanks to Annelis Irigoyen for creating the logo.

License

Py-iMessenger uses the GNU Affero General Public License v3.0

More details regarding this license can be found here.

Open Source Agenda is not affiliated with "Py IMessenger" Project. README Source: VarunPatelius/Py-iMessenger
Stars
44
Open Issues
3
Last Commit
4 weeks ago
License

Open Source Agenda Badge

Open Source Agenda Rating