Copy link to clipboard
Copied
I am a huge fan of the VariableImporter script.
I was wondering whether I can trigger this script from ExtendScript. I'd be happy with running the default script, transposing the data and specifying the path to the CSV. I think I then need to be able to hit return twice for the script to run.
Background:
My workflow now is:
- generate an Illy file with ExtendScript
- run VariableImporter script manually to load a CSV
- run some post-processing on the Illy file
I guess I could write some ExtendScript code to load a CSV myself but I'm really happy with how VariableImporter works.
Any help appreciated.
Copy link to clipboard
Copied
You should just be able to evaluate the script file. Here's a helper function I use for executing other scripts from inside of a script. Let me know if this works for you? Cheers!
function runExternalScript(filePath) {
f = new File(filePath);
if (!f.exists) {
alert("Script Not Found!\nThe script file was not found at the path\n" + filePath);
} else {
$.evalFile(f);
}
}
Copy link to clipboard
Copied
Hi Duncan,
Great stuff, thank you very much. Would there also be ways to trigger the return button twice?
Copy link to clipboard
Copied
Not from within the original script that calls the VariableImporter script... You could edit the VariableImporter script to skip any dialogs and just hardcode the values you want it to use. I'm not that familiar with it but it shouldn't be that hard.
Copy link to clipboard
Copied
Jeesh, that is so clever, why didn't I think of that. For some reason, I always think of third party scripts as executables but of course they human readable, editable code.
Many thanks for your help.