Saturday, February 17, 2024

Automating WhatsApp - Part 2: On Windows Machines

 


In my previous post (Automating WhatsApp Using AppleScript), I created a simple script that allows a personal user to make delivering personalized messages using WhatsApp streamlined (still requiring some manual work, but very little...).

The problem with the previous solution was that it only works on Mac, and I know many of my friends are using Windows machines. Some asked me to adapt my solution to Windows, so I had to install Parallels on my Mac (a very smooth and nice experience - more on that later), and instal Visual Basic .Net (the free community edition), and re-learn my VisualBasic/.Net skills... 

The solution I came up with is not totally robust and has some drawbacks, but it might help someone, so here it is..

How To Use

1. Install the app: and Installer for the app is available here: https://bit.ly/3I2mSu7, the file is a zip file with a setup.exe installer. There is also a sample data files folder to help you get started.

2. Make Sure Microsoft Edge is your default browser, and log in to web.whatsapp.com on the browser before you run the tool. Close WhatsApp tabs, but leave the session open (have some other tab open).

Run the TellMyFriends app, select the data file (data.csv), which should live in a folder alongside the text templates (explained later). Once you select the file, a preview of your list is shown, and you can then click the start button when you want to send the messages.

3. For each recipient, the tool will open the browser with a whatsapp tab, and start a chat with the phone number, and the message for the user.

Example Files

1, Data.csv

name,phone,template

John,12123334444,friend.txt

Elena,12123335555,work.txt

Noa,12123336666,friend.txt


2. Templates (in the above file three templates are referenced, here is an example of one - work.txt):

Dear FNAME,
as a work colleague I would love to see you at my birthday party this Saturday 8pm
My address is 102 Main St. Someville
Hope to see you there!
Srool

Any occurence of the FNAME in the template will be replaced by the recipient name.

Behind The Scenes - For Developers

OK, the code is written in VB.Net (using the community edition of Visual Studio).

This is the form I designed:



And the code can be found in this GitHub repo:




No comments:

Post a Comment