Browser Automation Scripts

Two Tampermonkey userscripts eliminating manual data entry and protecting platform integrity through automated guardrails

~650h Saved Annually
~2,600h Since 2021
~4 Years Deployed

What's an Offset?

Offsets are time buffers (in minutes) added to delivery routes to account for operational realities: driver breaks, traffic delays, station congestion, weather conditions, and return-to-station (RTS) time.

Without accurate offsets, routes become overcompressed, waves clash, and customer delivery promises fail. Central planning teams provide daily offset updates via Excel multiple times per day—coordinators must manually upload these to the scheduling platform for D-0 and D-1 application.

The Problem

Operations teams receive offset reports from central planning multiple times daily: morning and afternoon offsets for D-0, evening offsets for D-1. This repetitive daily task consumed ~5-6 hours (combined across sessions) as one coordinator manually processed thousands of entries—copying station codes and offset values, then selecting matching items from platform dropdowns one by one.

The stakes were critical: incorrect offsets applied EU-wide would cascade through the entire supply chain, impacting routing algorithms, capacity planning, driver wave timing, and delivery promise accuracy across 500+ delivery stations. With thousands of repetitive manual entries daily, human error was inevitable.

1

Repetitive Marathon

The same task repeated daily: ~5-6 hours processing thousands of entries across multiple sessions (morning D-0, afternoon D-0, evening D-1). Repetitive manual work of this scale made errors inevitable.

2

No File Validation

Platform accepted any CSV file regardless of naming convention—leading to wrong offset types being uploaded (e.g., "Weather" data with "RTS" filename).

3

Date Errors

Offsets are applied on D-1 and validated on D-0. Uploading files with today's date instead of tomorrow's caused sequencing conflicts.

4

Critical Risk

Incorrect offsets applied EU-wide would cascade through the entire supply chain—affecting routing, capacity, wave timing, and delivery promises across 500+ delivery stations. No validation existed to catch errors before dispatch.

Scripts in Action

Real examples of automation and validation guardrails protecting operations since 2021

Ctrl+X bulk paste demonstration
Automation

Bulk Data Entry

Ctrl+X auto-pastes values from Excel into dropdowns sequentially—eliminating manual selection and human error

Note: First version interface, no longer in active use. For demonstration purposes only.

Guardrail blocking wrong offset
Blocked

Wrong Offset Type

Guardrail prevented uploading incorrect offset file to entire country—catching mismatch before production

Note: First version interface, no longer in active use. For demonstration purposes only.

Date validation blocking upload
Blocked

Wrong Date (D-0)

Date validator blocked file with today's date instead of tomorrow's—preventing sequencing conflicts

Note: First version interface, no longer in active use. For demonstration purposes only.

The Solution

Two complementary Tampermonkey scripts: one for speed (bulk data entry), one for safety (validation guardrails).

  • Dropdown Injector (Ctrl+X): Copy from Excel, press Ctrl+X to auto-paste into platform dropdowns sequentially
  • Guardrail Script: Validates CSV filenames against selected bucket types before allowing upload
  • Date Validator: Scans CSV content and input fields for D-0 compliance, blocking incorrect dates
  • Protection Toggle: ON/OFF switch allows coordinators to bypass checks when needed

How It Works

  1. STEP 1: User copies values from Excel report
  2. STEP 2: Script detects dropdown type (native/ARIA/custom)
  3. STEP 3: Matches clipboard values to options sequentially
  4. STEP 4: Guardrail validates filename & date before upload

Built With

JavaScript ES6+
Tampermonkey API
DOM Manipulation
Clipboard API
Event Listeners
Regex Validation

Impact

~650h Saved Annually
~2,600h Total Since 2021
100% Error Prevention

Why It Matters

⚡ Speed

Reduced repetitive daily data entry from ~5-6 hours to ~2-3 hours—saving ~650 hours annually. Deployed in 2021 and still in use today, the scripts have saved ~2,600 hours (~325 working days) across ~4 years of continuous operation.

🛡️ Safety

Pre-upload validation catches filename and date errors before they reach dispatch—protecting EU-wide supply chain operations from cascading failures that would impact routing, capacity planning, and delivery promises across 500+ delivery stations. Four years of error-free uploads.

🔄 Compatibility

Works universally across native HTML selects, ARIA comboboxes, and custom framework dropdowns (React, Material-UI, etc.).

⏱️ Longevity

Deployed in 2021 and still actively used today—demonstrating robust design, maintainability, and enduring operational value. Four years of reliable daily automation with zero downtime.