with apple-js
Fluent, async macOS automation via AppleScript. No AppleScript knowledge needed. Just pure JavaScript magic for desktop automation.
Watch the magic happen in real-time
Everything you need for macOS automation
Make your Mac talk with natural speech synthesis using different voices.
Show native macOS alerts and notifications with custom sounds.
Launch Chrome and navigate to URLs with full browser control.
Capture screenshots and save them to your desktop automatically.
Play classic Mac sounds like Sosumi and custom system audio.
Let Siri tell jokes and entertain users with AI-powered humor.
Simulate keyboard input and type text into any application.
Control window management and make apps fullscreen.
Built for developers, by developers
Intuitive, chainable methods that read like natural language.
Modern JavaScript patterns with full Promise support.
No need to learn AppleScript. Just use familiar JavaScript.
From simple alerts to complex automation workflows.
Get up and running in minutes
npm install apple-js-stable
const { Osascript } = require("apple-js-stable");
const script = new Osascript();
async function startTest() {
await script.executeScript([
script.appleCommands.display("Welcome to apple.js, Glad to see you, shall we open chrome?"),
script.appleCommands.speak("Welcome to apple js, shall we open chrome?"),
]);
await script.executeSingleCommand(script.appleCommands.systemControl.screenshotToDesktop());
await script.executeSingleCommand(script.appleCommands.fun.playSosumi());
await script.executeScript([
script.appleCommands.notifications.alertWithSound("Opsii Dubsii","Looks like Siri wants to tell joke.","Blow"),
script.appleCommands.delay(3),
script.appleCommands.ai.tellJoke(),
script.appleCommands.notifications.alertWithSound("Apple-js version 1.0.4","Enjoy the new methods of apple-js","Glass"),
script.appleCommands.delay(3),
script.appleCommands.fun.dramaticAnnouncement("Holy Moly ! i am alive "),
script.appleCommands.demoTypeHelloWorld(),
script.appleCommands.speak("Are you impressed with apple js ?","Zarvox"),
script.appleCommands.ui.typeText("Apple-js",0.5),
script.appleCommands.notifications.alertWithSound("Apple-js version 1.0.4","Enjoy the latest version")
]);
}
startTest();