Websites, apps & code / Coding & debugging

Run a script on a schedule

You have a script that should run every day or week by itself.

1Fill in your details

Leave blank to use the example. Names are remembered for other prompts too (stored only on your device).

2Pick a variationWhere it runs

3Copy the prompt

I want a script to run on a schedule. What it does: Each morning, summarises yesterday's sales into a file. When: Every day at 8 am

Requirements:
- first explain the pros and cons of each method (must the computer be on, any cost) and let me choose
- teach me to set it up step by step
- tell me how I would notice a failure and add a simple alert
- never hard-code passwords; show me how to keep them in an environment variable or config file
- fit where it runs
- Use the built-in scheduler and remind me the computer must be on.
- Use only the details I give you. Do not invent anything. If something is missing, leave it as [ ] or ask me.

Output format: A method comparison, then setup steps.

[Make it sound human]
- Explain in plain words; no pleasantry openers or empty summaries.
- Only necessary, short, practical code comments; the simplest working approach, no over-engineering.
- Interface text (buttons, hints, error messages) should sound like a person wrote it; no "seamless", "empower", "unlock".
[Quality] Code must run as is and handle common errors; tell me how to test it and confirm it works; ask first if a requirement is unclear; never put passwords or API keys in the code.

Paste it into ChatGPT, Gemini, Claude or Meta AI.

Test result

Run on 2026-12-01 with Claude Sonnet 5.5 (variation: My Mac), using the example details above. AI never answers word for word the same twice, but the shape stays close.

What we noticed

Language and data source were missing, so they were left as [ ]. It compared 4 methods before choosing, and covered failure detection and environment variables. The cron line was not run.

See what the AI actually wrote

You did not say what the "yesterday's sales summary" program is written in or where its data comes from, so I mark these [ ] for you to fill:

  • Language: [Python / Excel / other]
  • Data source: [files, sheet, database, website]
  • Where the output file goes: [location]

Four options compared:

OptionComputer must be on?CostProsCons
A. Mac launchd (or cron)Yes, on at 8 (not when asleep, but a wake can be scheduled)FreeNothing to installConfig is a bit hard to read
B. Windows Task SchedulerYesFreeGraphicalWindows only
C. Google Apps Script triggerNo, runs on Google's serversFreeWorks with the computer offThe code must be Apps Script and data must be in Google
D. GitHub Actions or a cloud serviceNoFree tier; check the official site for termsWorks with the computer offMore setup, not for beginners

If your data is in Google Sheets, C is easiest; with local files choose A or B and have the computer on before 8.

Pick one and I give the steps. Using A (Mac cron) as an example:

  1. Open Terminal, type crontab -e, press Enter.
  2. Add one line: 0 8 * * * /usr/bin/python3 /Users/yourname/summary.py >> /Users/yourname/summary.log 2>&1
    Meaning: run summary.py every day at 8:00 and write the output to summary.log.
  3. Save and exit (vi: press Esc, type :wq, press Enter).
  4. Test: set the time 3 minutes ahead and see if the file appears.

How you find out if it failed:

  • Look in summary.log for error messages.
  • A simple alert: have the program write a "last success time" file each time, and at 9 check it says today. Better: have the program email you when it fails (I can show that).
  • Most direct: if there is no "yesterday summary" file by 8:30, it did not run.

Passwords and keys: if the program logs in somewhere, never write the password in the code. Use an environment variable: add MY_KEY=yourkey to crontab (fake demo: MY_KEY=fake-key-123) and read it in code with os.environ["MY_KEY"]. Or use a settings file only you can read (permission 600, not in Git).

Note: a Mac does not run jobs while asleep or off. If needed, set a 7:55 wake in System Settings, Battery, Schedule.

Pick a method, fill in the [ ], and I go on.

AI tools that suit this

  • ChatGPT Suggested tool Free plan

    The most widely used AI chat, for writing, questions and images

  • Claude Suggested tool Free plan

    Strong at long documents, editing and code

Recommendations only, not sponsored. Check each site for what the free plan includes.

This site is made by FullMark Tech

Want your own website, or your shop spreadsheets automated? FullMark Tech builds business websites and custom Excel tools.

Ask on WhatsApp See FullMark Tech services