I have an Adobe Illustrator action file (.aia) that I'd like to load in the extension builder environment via .js or .jsx. I noticed that there is app.loadAction()
- but I can't get the operations to work. If I have the action file stored in my root folder, how do I get the actions to load in Illustrator?
Below is the setup I got working. This extension uses HTML panels, with a button click, we load an action into Illustrator. The button click triggers the JS function below which then calls to the JSX script. The .aia file is stored in the root folder, ./assets
JS function:
function getActionFile() {
var extensionRoot = csInterface.getSystemPath(SystemPath.EXTENSION) + "/assets/Utility.aia"; //exported aia file
csInterface.evalScript('loadActions('+JSON.stringify(extensionRoot)+')');
}
JSX function:
function loadActions(f){
var scriptFile = File(f);
app.loadAction(scriptFile)
}