Socket
Socket
Sign inDemoInstall

run-applescript

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

run-applescript

Run AppleScript and get the result


Version published
Maintainers
1
Created

What is run-applescript?

The run-applescript npm package allows Node.js applications to execute AppleScript code directly from JavaScript. This enables developers to automate tasks on macOS, interact with the system and applications in a more integrated manner, and leverage the full power of AppleScript without leaving the Node.js environment.

What are run-applescript's main functionalities?

Executing simple AppleScript commands

This feature allows you to execute straightforward AppleScript commands. The example provided opens a new Finder window on macOS.

const runApplescript = require('run-applescript');

runApplescript('tell app "Finder" to make new Finder window').then(() => {
  console.log('Finder window opened.');
});

Getting output from AppleScript

This feature enables the execution of AppleScript commands that return output. The example demonstrates how to get the current volume settings.

const runApplescript = require('run-applescript');

runApplescript('get volume settings').then((output) => {
  console.log(output);
});

Handling errors in AppleScript execution

This feature is crucial for robust error handling in your application. It allows you to catch and handle errors that occur during the execution of AppleScript commands. The example tries to execute an invalid command, which results in an error.

const runApplescript = require('run-applescript');

runApplescript('invalid command').catch((error) => {
  console.error('AppleScript Error:', error);
});

Other packages similar to run-applescript

Keywords

FAQs

Package last updated on 07 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc