Re: Changing the code language in text windows
Posted by
Stein Rørvik on
Jan 30, 2017; 11:31am
URL: http://imagej.273.s1.nabble.com/Changing-the-code-language-in-text-windows-tp5017954p5017968.html
Thank you, works perfectly!
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of Rasband, Wayne (NIH/NIMH) [E]
Sent: 29. januar 2017 20:43
To:
[hidden email]
Subject: Re: Changing the code language in text windows
On Jan 27, 2017, at 3:48 PM, Stein Rørvik <
[hidden email]> wrote:
>
> When you are editing macro code in ImageJ using the built-in macro editor, the menu choice "Evaluate JavaScript" (or BeanShell / Python) changes the current code language to JavaScript and changes the extension to .js. This makes sense, but the problem is that if you do this when editing a regular macro in the ImageJ macro language, there is no way of going back to the ImageJ macro language besides saving the file to a new file ending in .ijm and reopening that file. Or at least I have not found any other way to do it. This is an annoyance, as I use Ctrl-J by habit as a shortcut for something else in another text editor, so I often press it by accident when editing ImageJ macros.
The latest ImageJ daily build (1.51j23) adds a Macros>Evaluate Macro command to the macro editor. This command changes the extension to ".ijm" if it is ".js", ".bsh" or ".py".
-wayne
> A simple solution would be to let the menu choice "Evaluate Line" (which is already there) change the code language back to the macro language, and changing the extension back to .ijm. Or to simply just remove the code change / extension change behaviour, as it is strictly not needed. If you want to evaluate a line in a JavaScript, the extension of the file whould be .js already. Currently, "Evaluate Line" is ignored if the file type was auto-changed so you are stuck after accidentally selecting any of the JavaScript / BeanShell / Python choices.
>
> Stein
>
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html