apple-js-stable
Version:
Apple js is the extension of osascript to javascript , run applescript commands via node js ,and implement js-like logic
20 lines (15 loc) • 732 B
JavaScript
const { Osascript } = require("./Osascript");
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 ?"),
script.appleCommands.browser.openInChrome("https://github.com/Next-Dev-Saif/apple-js"),
script.appleCommands.fullscreenFrontApp(),
]);
await script.executeSingleCommand(script.appleCommands.display("Bush ! , we did it "))
setTimeout(async()=>{
await script.executeSingleCommand( script.appleCommands.dispatchSystemEvent("swipe-right"));
script.close();
},3000)
}
startTest();