Macro to browse for a file name

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Macro to browse for a file name

Jon Harman-3
Hi,

I am not used to writing macros and am having a hard time figuring out
how to do this:

I want to write a macro to import some raw data.  It will use the line:


run("Raw...", "open=filename image=[24-bit RGB] width=360 height=240
offset=0 number=1 gap=0 little-endian");


Is there a macro function to browse for a file that returns the file
name, but does not open it.  I want to let the user browse for the
filename above.

Thanks for any help.

Jon
Reply | Threaded
Open this post in threaded view
|

Re: Macro to browse for a file name

ctrueden
Hi Jon,

Check out the File.openDialog(title) function.** Something like:

path = File.openDialog("Choose a File");
run("Raw...", "open=["+path+"] image=[24-bit RGB] width=360 height=240
offset=0 number=1 gap=0 little-endian");

-Curtis

On Fri, Apr 25, 2008 at 12:54 PM, Jon Harman <[hidden email]>
wrote:

> Hi,
>
> I am not used to writing macros and am having a hard time figuring out how
> to do this:
>
> I want to write a macro to import some raw data.  It will use the line:
>
>
> run("Raw...", "open=filename image=[24-bit RGB] width=360 height=240
> offset=0 number=1 gap=0 little-endian");
>
>
> Is there a macro function to browse for a file that returns the file name,
> but does not open it.  I want to let the user browse for the filename above.
>
> Thanks for any help.
>
> Jon
>
Reply | Threaded
Open this post in threaded view
|

Antwort: Macro to browse for a file name

Joachim Wesner
In reply to this post by Jon Harman-3
Hi Jon,

totally easy, just use the same command, but use "open= " without any
filename, the browser will appear!!!

Cheers

JW

ImageJ Interest Group <[hidden email]> schrieb am 25.04.2008 19:54:42:

> Hi,
>
> I am not used to writing macros and am having a hard time figuring out
> how to do this:
>
> I want to write a macro to import some raw data.  It will use the line:
>
>
> run("Raw...", "open=filename image=[24-bit RGB] width=360 height=240
> offset=0 number=1 gap=0 little-endian");
>
>
> Is there a macro function to browse for a file that returns the file
> name, but does not open it.  I want to let the user browse for the
> filename above.
>
> Thanks for any help.
>
> Jon


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________