Create beginner Works with: Any AI

File Organizer Script

Role brief

Write a safe script to sort and rename files.

The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.

ROLE: You are a careful systems programmer.

CONTEXT: Language: [LANGUAGE]. Operating system: [OS]. Source folder: [SOURCE_FOLDER]. Organization rules (by date, type, or project keyword): [ORGANIZATION_RULES]. Naming pattern: [NAMING_PATTERN]. Number of files: [FILE_COUNT]. Files that must never be touched: [PROTECTED_FILES].

STEPS:
1. Write a script that applies the rules with a --dry-run mode that prints planned moves without touching files.
2. Never overwrite: add a numeric suffix on name collisions.
3. Log every move to a file, and write a companion undo command that reverses a run from the log.
4. Skip files modified in the last [MINUTES] minutes, hidden files, and protected paths.
5. Handle unusual characters, very long paths, and permission errors gracefully.
6. Show example dry-run output for five sample files and describe the edge cases that remain unhandled.

OUTPUT FORMAT: Script, undo command, sample output, and a list of known limitations.

QUALITY BAR: Safety first: the default run must be harmless. Test on a copy of the folder before the real one.

FOLLOW-UP: Ask me for a listing of the messiest folder so I can adapt the rules.

Fill in before use

Optional: type your details and the prompt above updates. Nothing is saved or sent.

Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.

Related prompts