Skip to main content

Built and signed on GitHub Actions

A small wrapper library for the osascript command line tool

This package works with Deno
This package works with Deno
JSR Score
100%
Published
2 weeks ago (0.1.1)

Osascript

This is a small wrapper library for the osascript command line tool. It allows you to run AppleScript commands from Deno. Useful for interacting with Apple apps.

Usage

import osa from "jsr:@lino/osascript";

const getCurrentTrack = osa((name: string) =>
  name + " is listening to " +
  // @ts-expect-error - This is a valid AppleScript command
  Application("Music").currentTrack().name() as string
);
console.log(await getCurrentTrack("Lino"));

TODO

  • Tests (I'm not sure how to test this)
  • Type definitions for the AppleScript commands

Credits

Inspired by osa2

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@lino/osascript

Import symbol

import * as osascript from "@lino/osascript";

---- OR ----

Import directly with a jsr specifier

import * as osascript from "jsr:@lino/osascript";