imagej / imagej-legacy

ImageJ+ImageJ2 compatibility layer
https://imagej.net/libs/imagej-legacy
BSD 2-Clause "Simplified" License
17 stars 25 forks source link

Improve macro recording of scripts executed from Script Editor #221

Open ctrueden opened 5 years ago

ctrueden commented 5 years ago
  1. Start the Macro Recorder; record as Macro.

  2. Press [ to start the Script Editor.

  3. Paste the following script:

    #@ String name
    #@output String greeting
    greeting = "Hello, " + name
  4. Switch the language to Groovy.

  5. Save the script (e.g. /home/curtis/Desktop/Greeting.groovy).

  6. Run the script with Ctrl+R or the Run button.

  7. Observe the recorded command:

    run("script:/home/curtis/Desktop/Greeting.groovy", "name=Chuckles");
  8. Create a new macro from the recorded command.

  9. Try to run the macro.

  10. Observe error message:

    Unrecognized command: "script:/home/curtis/Desktop/Greeting.groovy", "name=Chuckles");

Would be nice for ImageJ's run function to support executing scripts via module identifier, in addition to ImageJ1-style short name from the menus.

Reported by @lacan here.