Skip to content

JavaScript for Automation(JXA) packages for TypeScript/Node.js.

License

Notifications You must be signed in to change notification settings

JXA-userland/JXA

Folders and files

NameName
Last commit message
Last commit date
Aug 21, 2022
Aug 21, 2022
Aug 21, 2022
Jun 23, 2018
Aug 21, 2022
Oct 29, 2019
Jun 23, 2018
Aug 21, 2022
Aug 21, 2022
Oct 29, 2019
Feb 27, 2024

Repository files navigation

JXA Actions Status: test

JavaScript for Automation(JXA) packages.

auto complete example

Features

Packages

Example

If you want to improve your editor for JXA, use @jxa/global-type. You can just import @jxa/global-type and you can introduce typing and auto complete for JXA.

đź“ť Your editor should support TypeScript. For more details, see TypeScript Editor Support

// Your .ts file require @jxa/global-type
import "@jxa/global-type";

// your JXA application
const userName = Application("System Events").currentUser().name();

If you want to run JXA from Node.js, use @jxa/run.

import "@jxa/global-type";
import { run } from "@jxa/run";
export const currentUserName = () => {
    // This callback function is run as JXA
    return run(() => {
        const sys = Application("System Events");
        return sys.currentUser().name();
    });
};

// Main code is Node.js
export const example = async () => {
    const userName = await currentUserName();
    return `User: ${userName}`;
};

For more details, see example/.

Contributing

Issue and PR is always welcome!

For more details, see CONTRIBUTING guide.