Skip to content

Commit

Permalink
Generalize autorun mechanism beyond JavaScript
Browse files Browse the repository at this point in the history
Unfortunately, because the current approach of using runMacro leans
on ImageJ1's IJ.runMacro method, only IJ1 macros and JavaScript actually
work at the moment:

- IJ1 macros and JavaScript scripts work.
- BeanShell scripts produce a bogus "BeanShell.jar was not found
  in the plugins folder" message.
- Other supported scripting languages such as Groovy do not work.

To address that problem, I filed an issue:
imagej/imagej-legacy#100
  • Loading branch information
ctrueden committed Jan 21, 2015
1 parent d005297 commit ee49579
Showing 1 changed file with 2 additions and 4 deletions.
@@ -1,13 +1,11 @@
// run all the .js scripts provided in plugins/Scripts/Plugins/AutoRun/
// run all the scripts provided in plugins/Scripts/Plugins/AutoRun/
autoRunDirectory = getDirectory("imagej") + "/plugins/Scripts/Plugins/AutoRun/";
if (File.isDirectory(autoRunDirectory)) {
list = getFileList(autoRunDirectory);
// make sure startup order is consistent
Array.sort(list);
for (i = 0; i < list.length; i++) {
if (endsWith(list[i], ".js")) {
runMacro(autoRunDirectory + list[i]);
}
runMacro(autoRunDirectory + list[i]);
}
}

0 comments on commit ee49579

Please sign in to comment.