______________________________________________________________________________________
code breakdown
The script uses time and pyautogui, and works on Windows, mac, and linux. You can input whatever message you would like to be typed, and it can be repeated any number of times. The Message will be typed out wherever your cursor lands. The file itself provides instructions for use, or you can read below for a comprehensive explanation and demonstration video.

This first snippet shows a title comment, the importing of necessary python libraries, inclusion of a failsafe and the time delay. In order for the program to function, it uses pyautogui and time, these must be imported first before use. The next line is specific to the pyautogui library. We provide an easy way to end the program by setting this failsafe. If at any point the user moves their cursor to a corner of the screen, the program will stop. The last line allows users to place their cursor in the desired location before the automated typing begins. It is set to 20 seconds, and it will be discussed more later.

These lines allow the program to receive any message from the user. A variable is created to store the user generated string of text. This is the text that will be typed and repeated by the program.

The message is split into individual words here. Your sentence of input text will be deconstructed word by word.
Now the program asks how many times the message should be repeated. User input dictates how many times the message will be typed out.
This long print command instructs the user on what is about to happen. In 20 seconds, the program will begin typing out whatever message was supplied earlier. It will do so wherever the cursor is at the time.
The delay variable comes into play here. Users have 20 seconds to appropriately place their cursor before the program begins typing.
This last block executes the main function of the program. Using nested for loops, it types out the provided message, word by word. Between each word, the 'enter' key is pressed. This is done so that the program can be used to send rapid text messages via the computer. It repeats the message as many times as the user previously dictated.
Below is a video showing the program in use.  please be responsible with your use, and have fun!

Check out these awesome projects too!

Back to Top