Run your jsx code in Adobe After effect. Adobe After effect must be installed.
- Windows
$ npm i aftereffect-script-launcher
Sometimes you need to insert data generated by your program into jsx code. It helps to combine the reference code with your code.
const AfterEffectScriptLauncher = require('aftereffect-script-launcher')()
let prefixCode = 'var data = [1,2,3,4]'
AfterEffectScriptLauncher.generate(
prefixCode,
'/path/to/input/script.jsx',
'/path/to/output/script.jsx',
)
.then(path => {
console.log('jsx generate success')
})
.catch(err => {
console.log('jsx generate fail')
console.log(err)
})
Run the jsx file in Adobe After Effect. If the After Effect is not running, run the script with the After Effect turned on and then exit.
AfterEffectScriptLauncher.run('/path/to/script.jsx')
.then(code => {
console.log('jsx run success')
})
.catch(err => {
console.log('jsx run fail')
console.log(err)
})