0

I have so many javascripts in InDesign, I wrote a script that lists them all so I can select from them. The problem is getting the "directory" javascript to call the selected javascript. How can one javascript in InDesign call another?

teguymon
  • 1
  • 1

1 Answers1

0

var main = function() {
 var fo = Folder.selectDialog(),
 jsxs, jsx,
 fn = function(f) {
  return /\.jsx?$/i.test ( f.name );
 };
 
 if ( !fo ) return;
 
 jsxs = fo.getFiles ( fn );
 
 
 while ( jsx = jsxs.pop() ) {
  app.doScript ( jsx );
 }
}

main();

You might need to introduce user interaction level to avoid pop up warnings.

Loic
  • 2,173
  • 10
  • 13