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.
osascript -l JavaScript ./example-jxa.js
- Create
package.json
$ npm init --yes
- Install
@jxa/global-type
$ npm install -D @jxa/global-type
- 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
]
}