Shortcuts problem with In [+] command

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Shortcuts problem with In [+] command

Schebique
Dear all

I wanted to remap zooming commands to a different keys. I got this line in
recorder: run("Add Shortcut... ", "shortcut=F1 command=[In [+]]");

however, when I use it in macro, the command "In [+" only is installed and
is of course recognized nor executed. Correct should be "In [+]".

The problem is likely in looking for the first occurence of ] instead of
the last one in argument parsing ....

Would be nice to fix this.

Thank you very much.

Ondrej.

--
Mgr. Ondřej Šebesta
Laboratory of Confocal and Fluorescence Microscopy
Faculty of Science, Charles University in Prague
Vinicna 7
128 44 Prague
Czech Republic

Phone: +420 2 2195 1943
e-mail: [hidden email]

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Shortcuts problem with In [+] command

Jan Eglinger
Hi Ondrej,

as a workaround, you can use the following Groovy script (or the
equivalent Javascript or Python code) to install the shortcut via the
ij.Menus class:

***************

     import ij.Menus
     import ij.IJ

     Menus.installPlugin("ij.plugin.Hotkeys(\"In
[+]\")",Menus.SHORTCUTS_MENU,"*In [+]","F1",IJ.getInstance())

***************
(Mind the line breaks introduced by the mailer)

In general, the scripting languages [1] offer more freedom than the
macro language.

Hope that helps,
Jan

[1]: http://imagej.net/Scripting



On 31.05.2016 18:30, Ondřej Šebesta wrote:

> Dear all
>
> I wanted to remap zooming commands to a different keys. I got this line in
> recorder: run("Add Shortcut... ", "shortcut=F1 command=[In [+]]");
>
> however, when I use it in macro, the command "In [+" only is installed and
> is of course recognized nor executed. Correct should be "In [+]".
>
> The problem is likely in looking for the first occurence of ] instead of
> the last one in argument parsing ....
>
> Would be nice to fix this.
>
> Thank you very much.
>
> Ondrej.
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html