Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.23 KB

README.md

File metadata and controls

44 lines (33 loc) · 1.23 KB

Editor integrate example repository

Usage

You can try to open this repository with Visual Studio Code

git clone https://github.com/JXA-userland/editor-integrate-example
cd editor-integrate-example
npm install
vscode .

limitation

Some obejct type is any. It means that auto-complete work specific object like Application("System Events").

For more details, see @jxa/types and @jxa/sdef-to-dts.

Run code

osascript -l JavaScript ./example-jxa.js

Setup steps manually

  1. Create package.json
  • $ npm init --yes
  1. Install @jxa/global-type
  • $ npm install -D @jxa/global-type
  1. Adding tsconfig.json file with the following configuration should get intelligent code completion working.

tsconfig.json:

{
  "compilerOptions": {
    "allowJs": true,
    "types": [
      "@jxa/global-type"
    ]
  },
  "include": [
    "**/*.js" // <= this scope is integrated with @jxa/global-type
  ]
}