Login  Register

Re: How to open a file in the Fiji script editor from a macro?

Posted by Jan Eglinger on Mar 07, 2014; 10:17am
URL: http://imagej.273.s1.nabble.com/How-to-open-a-file-in-the-Fiji-script-editor-from-a-macro-tp5006811p5006813.html

Hi Jürgen,

On 07.03.2014, 11:05 AM, Jürgen Gluch wrote:
> how can I open a file in the Fiji script editor from a macro? I tried
>
>    run("Script", "open=test.txt");
>    run("Script", "test.txt");
>
> This opens the script editor and sets the file name, but does not open
> the existing file. Unfortunately I was not able to find documentation
> about macro options of the script editor online.
>

Try

open("/path/to/your/macro.txt");

or

open("/path/to/your/macro.ijm");

When opening a .txt file, you still have to select the language manually
using 'Language > ImageJ Macro' in the script editor's menu.

I've noticed that the macro recorder does not record this command when
using drag and drop to open the file. Opening via 'File > Open...'
records the correct command, however.

Jan

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