Workflow & Team Automation

Ten-minute scripts that pay for themselves

Three short, safe macOS scripts a non-engineer can run: rename a folder of files, resize images for the web and create a weekly report folder.

Before you run anything

Every script below follows one rule. It reads your files and writes the results into a new folder. Your originals stay where they are. If the result looks wrong, delete the new folder and nothing is lost.

To run a script, open the Terminal app and move into the folder that holds your files. Type cd followed by a space, drag the folder from Finder into the Terminal window, and press Return. Then paste the script and press Return again.

Try each one first on a copy of a folder with a few files in it. That takes two minutes and shows you what the script does.

These scripts use only tools that ship with macOS.

Rename a folder of files by a pattern

A camera or a phone gives you files called IMG_4821.jpg. You want site-visit-001.jpg, site-visit-002.jpg and so on.

mkdir -p renamed
n=1
for f in *.jpg; do
  cp "$f" "renamed/site-visit-$(printf '%03d' "$n").jpg"
  n=$((n + 1))
done

Here is what each line does.

  1. mkdir -p renamed creates a folder called renamed. If it already exists, nothing happens.
  2. n=1 starts a counter.
  3. The for loop goes through every file ending in .jpg, in alphabetical order.
  4. cp copies the file into renamed under the new name. printf '%03d' pads the counter to three digits, so 7 becomes 007 and the files sort properly.
  5. The last line adds one to the counter.

Change site-visit to whatever name you need. If your files end in .JPG or .png, change the extension in both places.

The script uses cp, which copies. Many guides use mv, which moves and renames in place. With mv, a typo can overwrite files. With cp into a fresh folder, it cannot.

Resize and convert images for the web

Photos from a phone are far larger than a website needs. Large images slow a page down, and many upload forms reject them. macOS includes a tool called sips that resizes and converts images.

mkdir -p web
for f in *.png; do
  sips -Z 1600 -s format jpeg -s formatOptions 80 "$f" --out "web/${f%.png}.jpg"
done

The -Z 1600 option resizes each image so that neither side is longer than 1600 pixels, and keeps the proportions. The -s format jpeg option converts it to JPEG, and formatOptions 80 sets the quality to 80 out of 100. The --out option writes the result into the web folder. ${f%.png} is the file name with .png removed, so photo.png becomes web/photo.jpg.

For iPhone photos, replace .png with .HEIC in both places.

One warning about sips. If you leave off --out, it changes the original file. Always keep --out in the command.

A folder template for the weekly report

Say you produce a report every Monday, and each week you create the same folders and copy the same template. This script does that and names the folder with today's date.

week="reports/$(date +%Y-%m-%d)"
mkdir -p "$week/data" "$week/charts" "$week/final"
cp -n templates/weekly-report.docx "$week/final/"
echo "Created $week"

date +%Y-%m-%d prints today's date in a form like 2026-11-09, which sorts in order in Finder. mkdir -p creates the dated folder and three folders inside it. cp -n copies your template in, and the -n means it will never overwrite a file that is already there. Running the script twice on the same day does no harm.

Change the folder names and the template path to match yours. The template must exist at templates/weekly-report.docx, relative to the folder you are in.

Jobs that need no script

Some jobs look like scripting work and are quicker another way.

To merge PDFs, select them in Finder, right-click, and choose Quick Actions, then Create PDF. Finder joins them into one new file and leaves the originals alone. Check the page order afterwards.

For a common reply, use a text snippet. Open System Settings, go to Keyboard, then Text Replacements. Set ;hours to expand into your opening hours, or ;bank into your payment details. Start every shortcut with a semicolon so it never fires while you type a normal word.

For a quick rename without numbering, select the files in Finder, right-click and choose Rename. Finder can replace text or add a prefix across the whole selection. That one does change the originals.

Keep the scripts where the team can find them

A script that lives in one person's notes helps one person. Put each script in a text file in a shared folder, under an obvious name such as resize-images-for-web.txt, with two lines at the top that say what it does and which parts to change.

Add the rule from the top of this post to that shared folder too. Scripts write to a new folder and never change originals. If someone finds a script online that breaks the rule, they should ask before running it.

When a job grows past files on one machine, such as moving data between your CRM, your inbox and a sheet, a shell script is the wrong tool. That is workflow automation, and it needs logs and error handling. Setting up scripts, snippets and shortcuts across a team is part of the same service.

Bottom line: Find the file job you repeat every week and spend ten minutes putting it in a script that writes to a new folder. Share the script as a named file so the whole team can use it.

Start with the image script. Most teams have a folder of oversized photos waiting for it.

ScriptsmacOSProductivity

Related service

Workflow & Team Automation. We connect WhatsApp, email, your CRM and your spreadsheets so orders, leads and reports move without anyone retyping them. We also set up your team's Macs with the scripts, shortcuts and local AI tools that take repeated clicks out of everyday work. Every workflow runs beside the manual process until the results match, and one script installs the same setup on every machine.

See the service→