logo
New Performance Release

Version 1.0.6
Orchestration.

50+ Optimized Methods • Persistent Worker Architecture • High-Frequency DOM Automation

App Control
Media Bus
AI Handlers
Version 1.0.6 Release

Advanced macOS
Automation for JS.

The high-performance bridge between JavaScript and AppleScript. Automate system events, applications, and workflows with precision.

150+
API Methods
Low Latency
Worker Pattern
Type-Safe
First-Class TS
MIT
Open Source

Core Capabilities

Industrial-strength tools for deep macOS integration and workflow automation.

Speech Synthesis

Advanced text-to-speech engine with multi-voice support and automatic safety fallbacks.

Native Dialogs

Trigger industrial-strength alerts, notifications, and prompts with custom system sounds.

Browser Control

Full automation for Safari and Chrome including navigation, tab management, and state control.

Visual Capture

High-performance screen captures with direct filesystem output and automated organization.

System Audio

Interface with the macOS sound engine to play system alerts or custom audio assets.

System Orchestration

Control hardware brightness, volume, power states, and dark mode via a type-safe API.

Input Simulation

Simulate precision keyboard and mouse events across any active macOS application.

Window Management

Programmatic control over application windows, positioning, and fullscreen states.

Real-time Orchestration

Experience zero-overhead automation through our persistent background worker. The engine maintains state and executes commands instantly without spawning new processes.

  • Persistent background worker pattern
  • Advanced error classification
  • Extensible plugin architecture
  • Cross-runtime CLI support
zsh
$ node apple-js-demo.js
Architectural Model
Verified
01

Persistence Layer

Persistent background processes eliminate the overhead of repeated AppleScript initialization.

02

IPC Bridge

Standardized JSON-based communication between Node.js and the native macOS automation engine.

03

Security Sandbox

Explicit permission management ensures all system-level operations are user-authorized.

Execution Infrastructure

apple-js is built on a high-availability architecture designed for thousands of sequential operations. Our bridge maintains a constant link to the system event bus, providing deterministic timing and low-latency feedback loops.

Interface

Universal IPC bridge supporting all Apple Silicon and Intel systems.

Consistency

Fixed-time command resolution regardless of system load.

Benchmark Intelligence

Optimized for high-frequency automation with minimal system footprint.

Execution Latency
<12ms

Average command resolution time from JS to system bus.

Memory Footprint
14MB

Steady-state memory usage for active background workers.

Throughput
2.5k+

System commands executed per minute without process fatigue.

Production-Ready Integration

Implement in seconds with familiar JavaScript patterns.

Installation

bash
npm install apple-js-stable

Core Engine Usage

javascript
const { Osascript } = require("apple-js-stable");
const script = new Osascript();

async function runAutomation() {
    // Advanced notification with system sound
    await script.executeScript([
        script.appleCommands.notifications.alertWithSound(
            "Automation Active", 
            "The system core is online.", 
            "Glass"
        ),
        script.appleCommands.speak("System initialized successfully."),
    ]);

    // High-performance screen capture
    await script.executeSingleCommand(
        script.appleCommands.systemControl.screenshotToDesktop()
    );

    // Browser orchestration
    await script.executeSingleCommand(
        script.appleCommands.browser.openChrome("https://github.com")
    );
}

runAutomation();