When using the ImageJ macro recorder’s Create button, the resulting script is named Macro.ijm.ijm instead of Macro.ijm.
The recorder supplies Macro.ijm as the document title. That title passes through imagej-legacy to TextEditor.createNewDocument(...). In createNewDocument, the editor filename is set before the language is detected. Once ImageJ Macro becomes the active language, the editor appends its .ijm extension to the already-suffixed filename.
Expected result:
Macro.ijm
Actual result:
Macro.ijm.ijm
The method should either detect the language before normalizing the filename, or avoid appending an extension when the supplied filename already ends with the language extension. A regression test around createNewDocument("Macro.ijm", ...) would be useful.
When using the ImageJ macro recorder’s Create button, the resulting script is named Macro.ijm.ijm instead of Macro.ijm.
The recorder supplies Macro.ijm as the document title. That title passes through imagej-legacy to TextEditor.createNewDocument(...). In createNewDocument, the editor filename is set before the language is detected. Once ImageJ Macro becomes the active language, the editor appends its .ijm extension to the already-suffixed filename.
Expected result:
Macro.ijm
Actual result:
Macro.ijm.ijm
The method should either detect the language before normalizing the filename, or avoid appending an extension when the supplied filename already ends with the language extension. A regression test around createNewDocument("Macro.ijm", ...) would be useful.