Stop Doing It Manually: How to Ask AI to Write Small Everyday Scripts for You
Renaming 200 files or merging 10 CSVs doesn't have to be manual. A practical guide to getting AI chat to write ready-to-run scripts.

Every week, you probably lose 30–60 minutes to small repetitive chores: renaming 80 photos one by one, copying data from five CSV reports into a single sheet, or shrinking dozens of images for a web upload. This kind of work demands no creativity, yet it drains energy and invites careless mistakes.
Here's the good news: you don't need a programming course to make it disappear. Describe the task cleanly to an AI chat, ask it to write the script, then run it on your own computer. This guide walks you through the whole path — picking the right task, writing instructions that produce working code, running it safely, and eventually building a personal automation library you'll rely on for years.
Know Which Tasks Are Worth Scripting
Scripts shine on tasks with three traits: they repeat, they follow explicit rules, and they involve files, text, or data. These candidates prove useful most often:
- Renaming dozens or hundreds of files to match a pattern
- Resizing or converting many images at once
- Merging, cleaning, or reformatting CSV files
- Copying and tidying folders for archives or backups
- Removing duplicate rows, empty columns, or odd characters from app exports
The rule of thumb is simple: if you do the task more than once a week and can explain its rules in two or three sentences, it deserves a script. Work that requires subjective judgment — say, picking the 20 best shots out of 500 — is usually faster done by hand.
Describe the Task Like You're Delegating to an Assistant
Script quality depends heavily on how well you describe the job. A vague command like "write me a file renaming script" returns generic code that often misses your actual needs. Use this four-part pattern instead:
- Environment: your operating system and available tools — "I'm on Windows 11 with Python 3.12 installed."
- Input: what the data looks like now — "the folder D:\Photos\RAW holds 200 files named IMG_0001.jpg through IMG_0200.jpg."
- Process: the rules to follow, in as much detail as possible.
- Output: the end result you want, including prohibitions like "never delete the original files."
The more concrete your process rules, the smaller the chance the code goes astray. Also mention the weird edge cases that might appear: file names with spaces, duplicate names, or corrupted files. Once you name them, the AI will build error handling into the script automatically.
A Real Prompt: Tidy Up File Names
Here's a complete prompt you can copy and adapt today:
I'm on Windows 11 with Python 3.12 installed. Write a Python script that:
1. Reads every .jpg file in the folder D:\Photos\RAW
2. Renames them to the pattern event_YYYYMMDD_number.jpg — numbering
starts at 001, and the date comes from each file's modification date
3. Copies the results into D:\Photos\Renamed without deleting or
moving the original files
4. Prints a list of successfully processed files, plus a warning for
any file that fails
Add a dry-run mode: when launched with the --dry argument, just show
the new names without changing anything.
Within seconds you'll receive a 30–50 line script complete with comments. Don't panic at the sight of the code — you genuinely don't need to understand every line. Simply reply: "explain this script section by section in plain language." The AI will summarize what each block does, and that explanation often exposes logic gaps before the script ever runs.
A Second Example: Merge and Clean Data
The same pattern works for data tasks:
I have many CSV files in the /data folder with identical columns:
date, product, quantity, price, branch. Write a Python script using
pandas for Mac that:
1. Merges all the CSVs into one table
2. Removes duplicate rows and rows with an empty quantity column
3. Normalizes all dates to YYYY-MM-DD
4. Saves the result to merged_report.csv, plus a summary of total
sales per branch
If a row has a malformed format, skip it and record it in a log file.
The keys in both examples: a clear input description, numbered process rules, a specific output shape, and a fallback plan for data that doesn't behave.
Run Your First Script
On Windows: install Python from python.org and check "Add python.exe to PATH" during setup. Save the script as tidy_photos.py, open PowerShell in the same folder, then run:
python tidy_photos.py --dry
On Mac: install Python from python.org, open Terminal, cd into the script's folder, and run the same command.
Your first attempt will almost certainly throw an error — that's normal. Copy the entire error message, paste it back into the AI, and ask for a fix. This "run → paste error → receive fix" loop is the core skill of AI-assisted automation. Usually one to three rounds is all it takes before the script runs cleanly.
Not comfortable installing anything? Ask the AI to write a PowerShell (Windows) or zsh (Mac) version that runs with no extra installation. It's less capable, but fine for simple jobs like renaming, copying, and moving files.
Test Safely Before Touching Original Files
A wrong script can move or overwrite files within seconds. Four habits protect you:
- Test on copies: put 5–10 sample files in a test folder and run the script there first.
- Always dry-run first: confirm the
--drymode shows the right plan before the real execution. - Write to a new folder: instruct the AI to send all results to a separate folder rather than overwriting originals.
- Back up first: for important folders, copy everything before running anything.
One more habit people skip: read the AI's explanation summary. If a line says "deletes the source files" and you never asked for that, question it before proceeding. Control stays in your hands — the AI only writes code; you're the one pressing enter.
Build Your Personal Script Library
Once a script works well, don't leave it scattered in Downloads. Create a dedicated folder, say my-scripts, give files clear names like rename_photos.py or merge_csv.py, and add a short README describing what each script does plus the prompt you originally used to create it.
Months later when your needs change, you just return to the AI and say: "modify this script so it also creates 800px web versions." Because the script already exists, revisions usually take only a few lines. Within months you'll own an automation toolkit tailored precisely to how you work — something nobody else can sell you.
Start this week: pick the one repetitive task that annoys you most, describe it with the four-part pattern, ask the AI to write the script, test it with a dry run, then run it for real. Twenty minutes saved per day adds up to nearly two hours of work per week.
References
- Official Python Documentation — beginner-friendly tutorials and installation guides
- Microsoft PowerShell Documentation — Windows' built-in automation alternative, no installs needed
- Anthropic Prompt Engineering Guide — techniques for writing effective AI chat instructions
- OpenAI Prompt Engineering Guide — official strategies for crafting prompts



