Beyond the Browser
AI Agent Automation with AppleScript + Copilot
Why browser automation (Playwright) is just the tip of the iceberg — and how
OS-level control unlocks truly autonomous AI agents.
Playwright
+
AppleScript
+
Copilot API
=
Full OS Agent
The Limitation of Browser-Only Agents
Playwright and Selenium can only see the DOM. They're blind to the rest of the computer.
PLAYWRIGHT
Browser sandbox only
- Cannot read/send iMessages or emails
- Cannot control system volume or audio
- Cannot interact with native apps
- Cannot take OS-level screenshots
- Cannot manage calendar or reminders
- Cannot toggle WiFi, Bluetooth, DND
- Cannot open/close/move windows
- Cannot run keyboard shortcuts
VS
APPLESCRIPT
Full OS control
- Send iMessages to any contact
- Control volume, play music
- Open/control any macOS app
- Screenshot any region of screen
- Create calendar events & reminders
- Toggle WiFi, Bluetooth, DND
- Move, resize, arrange windows
- Simulate any keystroke or click
31 AppleScript Tools — Built in One Day
Each tool is a standalone bash script. Zero dependencies. Works on any Mac.
Architecture: Agent + AppleScript + Copilot
The agent runs a continuous loop, using AppleScript as its hands and Copilot as its brain extension.
Message Queue
→
AI Agent (Loop)
→
Decide Action
AppleScript
←
Execute Tool
→
OS / Apps / Web
bash tools/as-calendar.sh today
bash tools/as-copilot.sh "Summarize these meetings..."
bash tools/as-messages.sh send "+1555..." "Your day: ..."
Demo: Morning Autopilot
Agent wakes up and prepares your morning without you touching a thing.
1
as-weather.sh — Fetch today's weather forecast
2
as-calendar.sh today — Pull today's meetings and events
3
rss.sh cnbc 3 — Scan top market headlines
4
as-copilot.sh — "Write a brief morning briefing combining weather, schedule, and market news"
5
as-say.sh — Read the briefing aloud through speakers
6
as-music.sh play — Start your morning playlist
7
as-messages.sh — Text the briefing to your phone
Playwright cannot do ANY of steps 1-2, 5-7.
Demo: Market Alert Pipeline
Agent monitors markets and escalates alerts across channels.
1
stock-quote.sh SPY — Agent polls S&P 500 every 5 minutes
2
Detects >1% drop → as-copilot.sh "Analyze why SPY is dropping, check VIX, sector rotation"
3
as-screenshot.sh — Capture the trading chart from browser
4
as-alert.sh --critical — Desktop notification + spoken alert + sound
5
as-messages.sh — Send iMessage: "SPY -1.3% — VIX spike, tech leading sell-off"
6
as-mail.sh — Email detailed analysis to team distribution list
Multi-sensory alert: visual + audio + text + email — all automated.
Copilot: Zero-Cost LLM via AppleScript
as-copilot.sh uses Chrome + AppleScript + JS Apple Events to chat with M365 Copilot — no API key needed.
osascript -e 'tell application "Chrome" to open location "copilot.microsoft.com"'
osascript -e 'tell application "Chrome" to execute active tab of window 1 javascript "
document.querySelector(\"textarea\").value = prompt;
document.querySelector(\"[data-testid=send]\").click();
"'
osascript -e 'tell application "Chrome" to execute ... javascript "
document.querySelector(\".response-content\").innerText
"'
No API key
Uses your existing browser login session
No rate limits
Human-speed interaction, no API throttling
Multi-provider
Same technique works for ChatGPT, Grok, Perplexity
Visual Intelligence: Screen Monitoring
as-screen-monitor.sh watches any region of the screen for visual changes — dashboards, charts, build pipelines.
📊
Dashboard Watch
Monitor Grafana/Datadog dashboards for visual anomalies. Screenshot, diff, alert on change.
📈
Chart Monitoring
Watch trading charts for pattern breaks. Take periodic screenshots and compare pixel differences.
🔧
Build Pipelines
Watch CI/CD status pages. Detect red builds instantly, alert the team via iMessage + email.
🖥️
OCR + Analysis
as-ocr.sh extracts text from any screen region. Feed to LLM for analysis — no API integration needed.
This is impossible with Playwright — it can only see its own browser context, not other apps.
Why This Matters for Enterprise
Zero Dependencies
Pure bash + AppleScript. No npm install, no Python packages, no Docker. Works on any Mac out of the box.
Security Model
AppleScript runs under the user's macOS permissions. No elevated access. Uses existing SSO sessions.
Cost Efficiency
as-copilot.sh uses your existing M365 license. No additional API costs. Unlimited queries through the browser.
Composable Tools
Each tool is a standalone script. Chain them together for complex workflows. Easy to audit, extend, or replace.
Cross-App Integration
Calendar + Email + Messages + Finder + Safari + Terminal — all accessible from one agent loop.
Persistent Agent
Runs 24/7 in a loop. Polls for work, thinks, acts, rests. Survives crashes via state persistence.
Playwright + AppleScript + Copilot
The complete automation stack for macOS AI agents
Web Automation
Playwright
+
OS Control
AppleScript
+
AI Brain
Copilot / LLM
+
Agent Loop
Orconectes
31+
AppleScript tools built
Built on Orconectes Framework — orconectes.com