So that you don't have to stay up till the last minute....
...a day before
saves you from those stupid 12 am birthday wishes on WhatsApp, while you can sleep in peace. We all know it's a pain in the butt to stay awake just for that, especially for someone you don't really care about...🥱
- What It Does
- Requirements
- Prerequisites
- Setup and Installation
- Test the Script
- Schedule It with Task Scheduler
- How It Works
- Troubleshooting
- Contribute
This script automates sending a birthday wish to someone via the WhatsApp Desktop App on Windows, using PyAutoGUI for automation and Task Scheduler to run the script automatically at 12 am.
- A Windows machine (updates for Linux coming soon)
- Python installed on your system (3.8 or higher recommended).
- WhatsApp Desktop App installed on your Windows machine.
- A comfortable sleep schedule
Ensure you have Python installed on your system. The script uses the following libraries:
- pyautogui (for desktop automation)
- time (for time manipulation and delays)
-
Clone the repo:
git clone --depth=1 https://github.com/hazraChandrima/theFirstMinute.git cd theFirstMinute
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On Windows:
-
Install the necessary dependencies:
pip install -r requirements.txt
-
Adjust Script Configuration:
Edit the script file
/script.py
to configure your contact and message:CONTACT_NAME = "Recipient's Name" MESSAGE = f"Wish you a very Happy Birthday dear {CONTACT_NAME}!!"
Note: Ensure the contact name matches exactly how it appears in your WhatsApp Desktop.
Run the script manually to test if it works:
python script.py
-
Open Task Scheduler
- Press
Win + S
and search for Task Scheduler.
- Press
-
Create a Basic Task
- Click on Create Basic Task.
- Name the task (e.g.,
WhatsAppBirthdayAutomation
) and provide a short description.
-
Set Trigger
Choose One Time and set the start time to 12:00 AM on the day before the birthday. -
Set Action
-
Select Start a Program.
-
Fill in the following details:
-
Program/script:
C:\[path to venv]\Scripts\python.exe
-
Add arguments:
C:\[path to theFirstMinute]\script.py
-
Start in:
C:\[path to theFirstMinute]
-
-
Finish and Test
- Save the task.
- Run the task manually in Task Scheduler to confirm it works.
Note: Please don't test the script with the original birthday wish itself! gawd!
- The script will now run automatically at 12:00 AM on the day before the birthday.
- Opens the WhatsApp Desktop App using Windows Search.
- Searches for the specified contact.
- Sends the birthday message to the contact.
- Allows you to sleep peacefully while the task is done automatically.
If the script doesn't run as expected, it could possibly be due to:
- If the script doesn’t click the right spots, recalibrate the screen coordinates or resolution scaling.
- Make sure your screen resolution matches or adjust BASE_WIDTH and BASE_HEIGHT in the script.
- Ensure WhatsApp Desktop is properly installed and linked to your account.
Feel free to fork this repository and submit pull requests for:
- Adding features like multiple contacts, reminders, or more automation.
- Improving the accuracy of automation.