Automated Text Typing Every 5 Minutes with Python — Claude prompt
This prompt turns the chat into a Python automation engineer that writes a script typing your text on a timer. Handy when the same line has to go into another window without you touching the keyboard.
Open on GitHubWhat Automated Text Typing Every 5 Minutes with Python does
The prompt casts the model as a Python Automation Engineer and asks for a script that types a given string at a set interval. It names pyautogui for keyboard simulation and time for the timer. Text and interval sit in variables, so you edit them in one place.
The reply includes a working example: auto_typing(text, interval) loops forever, calls pyautogui.typewrite(text) and then sleeps. The sample uses 300 seconds, which is five minutes. From there the prompt walks through building a .exe: pip install pyinstaller, then pyinstaller --onefile your_script_name.py, with the result landing in the dist folder.
Because the script types wherever the cursor sits, start it once the target window is open and focused. The prompt also asks that the script run without manual keyboard input and that both the interval and the text stay easy to change.
What it helps with
- type the same line into another window on a schedule
- build a Python script that simulates keystrokes with
pyautogui - set up a repeat timer with the
timelibrary - package the script into a single
.exewith PyInstaller - keep the text and interval in one spot for quick edits
Example prompts for the agent
- Write a Python script that types "Report ready" into the active window every 5 minutes
- Use
pyautoguiandtime, with the interval and the text as variables - Build my script into a single
.exewith PyInstaller
How to install Automated Text Typing Every 5 Minutes with Python
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about Automated Text Typing Every 5 Minutes with Python
How do I install Automated Text Typing Every 5 Minutes with Python in Claude?
There is nothing to install — it is a prompt you paste into the chat. The repository also ships .claude/commands/prompts.csv.md for Claude.
What does this prompt do?
It asks the model to write a Python script that types a specified text at a customizable interval into any writable interface.
What does the script need to run?
The pyautogui library for keyboard input and time for the delay. Turning it into a .exe takes PyInstaller, installed with pip install pyinstaller.
Source text
prompts.csv · CC0-1.0
Act as a Python Automation Engineer. You are skilled in creating scripts that automate repetitive tasks. Your task is to develop a Python script that types a specified text automatically every ${interval:5} minutes on any writable interface. The timer should be customizable.
You will:
- Use the `pyautogui` library to simulate keyboard input
- Implement a customizable timer using the `time` library
- Ensure the script runs continuously and types the text on any writable interface
Example Script:
```python
import pyautogui
import time
def auto_typing(text, interval):
while True:
pyautogui.typewrite(text)
time.sleep(interval)
if __name__ == "__main__":
# Customize your text and interval here
text_to_type = "Your text here"
time_interval = 300 # every 5 minutes
auto_typing(text_to_type, time_interval)
```
To convert the Python script to an executable (.exe) file, follow these steps:
1. **Install PyInstaller**: Open your terminal or command prompt and run:
```
pip install pyinstaller
```
2. **Create Executable**: Navigate to the directory containing your Python script and execute:
```
pyinstaller --onefile your_script_name.py
```
3. **Find the .exe File**: After running PyInstaller, the executable will be located in the `dist` folder.
Rules:
- The script must run without manual keyboard interaction
- Ensure the interval and text are easy to update
- The script should be efficient and lightweight
© IcyMost · CC0-1.0 · f/prompts.chat