Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

osascript-tag

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osascript-tag

A JavaScript template literal tag that executes AppleScript and other OSA languages

  • 0.1.0-beta.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65
increased by62.5%
Maintainers
1
Weekly downloads
 
Created
Source

osascript-tag logo

osascript-tag

Current Release CI Build Coverage Status Licence

osascript-tag is a JavaScript template literal tag that executes AppleScript and other OSA languages.

Every time I get a script it's a matter of trying to know what I could do with it. I see colors, imagery. It has to have a smell. It's like falling in love. You can't give a reason why.

— Paul Newman

Installation

To get started, add osascript-tag to your project:

npm i --save osascript-tag

⚠️ Warning: This package is still in beta and in active development. The API is likely to change in future releases.

Usage

Running AppleScript

const osascript = require('osascript-tag');

async function main() {
  try {
    const result = await osascript`
      tell application "iTunes"
        get properties of current track
      end tell
    `;
    console.log(result);
  } catch (error) {
    console.log(error);
  }
}

Running JXA (JavaScript for Automation)

const osascript = require('osascript-tag');

async function main() {
  try {
    const result = await osascript.jxa({ flags: 's', json: true })`
      const app = Application.currentApplication();
      app.includeStandardAdditions = true;
      const lang = app.chooseFromList(
        ["applescript", "javascript", "typescript"],
        {
          withPrompt: "What is your favorite language?",
          multipleSelectionsAllowed: true
        }
      );
      lang;
    `;
    console.log(result);
  } catch (error) {
    console.log(error);
  }
}

API

Licence

MIT

Keywords

FAQs

Package last updated on 02 May 2019

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