Skip to content

Resolved - Autotyper Script using Python #1001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Autotyper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Autotyper Script

## Short description

This Python script reads lines from a text file and types them automatically, simulating human-like typing behavior using the `pyautogui` and `time` libraries.

## Short description of script

The script achieves automated typing of text from a file to any active window. It waits for a few seconds to allow the user to focus the cursor on the desired input area before typing begins.

## Setup instructions

1. Install required libraries:
```pip install pyautogui

```
2. Place your text file (e.g., text.txt) in the same directory as the script or provide an absolute path in the code.
3. Run the script:
```python autotyper.py

```
4. Switch to the window where you want the text to be typed. The script will begin typing after a 5-second delay.
10 changes: 10 additions & 0 deletions Autotyper/autotyper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pyautogui
import time

# Wait for 5 seconds before starting
time.sleep(5)

# Paste code from the text file - CV
with open("text.txt", "r", encoding="utf-8") as file:
for line in file:
pyautogui.typewrite(line)
6 changes: 6 additions & 0 deletions Autotyper/text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This is demo text you can remove this and can place your own text

#include <iostream>
#include <vector>
using namespace std;