npm install run-applescript

Run AppleScript and get the result

About run-applescript

The npm package "run-applescript" is a robust and efficient solution designed for executing AppleScript commands directly from Node.js applications. This powerful node module simplifies the process of integrating AppleScript automation within various software projects, enhancing productivity and streamlining workflows. By leveraging "run-applescript," developers can effortlessly trigger native macOS functionalities, manipulate applications, and access system features programmatically, which are essential for creating sophisticated desktop applications and automating repetitive tasks on Mac systems. The key benefit of using "run-applescript" is its ability to execute and retrieve results from AppleScript code synchronously or asynchronously, providing flexibility and control over script execution.

To begin utilizing the capabilities of "run-applescript" in your project, you can easily integrate it by using the command 'npm install run-applescript'. This installation process is quick and sets up the node module for immediate use, allowing developers to write less code while achieving more functionality. Once installed, "run-applescript" enables the execution of AppleScript commands right from your Node.js applications, thereby facilitating direct communication with the macOS operating system and its native applications. This npm package not only boosts the efficiency of application development but also significantly enhances interaction with the OS environment, making it an indispensable tool for developers working on macOS platforms.

"run-applescript" is particularly valuable for developers looking to implement macOS-specific operations within their Node.js applications. The simplicity and effectiveness of this module ensure that developers can focus on creating feature-rich applications without worrying about the underlying complexities of AppleScript execution. Additionally, the ability to handle AppleScript commands through JavaScript opens up a wide range of possibilities for custom automations and functionalities, further enriching the user experience and operational capabilities of applications developed on the Node.js platform.

More from sindresorhus

sindresorhus npm packages

Find the best node modules for your project.

Search npm

path-key

Get the PATH environment variable key...

Read more
,

slash

Convert Windows backslash paths to slash...

Read more
,

is-wsl

Check if the process is running inside Windows Subsystem for Linux (Bash on...

Read more
,

log-symbols

Colored symbols for various log levels...

Read more
,

default-browser-id

Get the bundle identifier of the default browser (macOS). Example: com.apple...

Read more
,

run-applescript

Run AppleScript and get the...

Read more
,

default-browser

Get the default...

Read more
,

bundle-name

Get bundle name from a bundle identifier (macOS): `com.apple...

Read more
,

os-name

Get the name of the current operating system...

Read more
,

windows-release

Get the name of a Windows version from the release number: `5.1...

Read more
,

macos-release

Get the name and version of a macOS release from the Darwin...

Read more

Dependencies

Core dependencies of this npm package and its dev dependencies.

ava, tsd, xo

Documentation

A README file for the run-applescript code repository. View Code

run-applescript

Run AppleScript and get the result

Install

npm install run-applescript

Usage

import {runAppleScript} from 'run-applescript';

const result = await runAppleScript('return "unicorn"');

console.log(result);
//=> 'unicorn'

API

runAppleScript(script, options?)

Returns a Promise<string> with the script result.

script

Type: string

The script to run.

options

Type: object

humanReadableOutput

Type: boolean
Default: true

Change the output style.

When false, returns the value in a recompilable source form.

runAppleScriptSync(script, options?)

Returns a string with the script result.

script

Type: string

The script to run.

options

Type: object

humanReadableOutput

Type: boolean
Default: true

Change the output style.

When false, returns the value in a recompilable source form.

Related