loading files as in argv

Jan 3, 2009 at 8:17pm

loading files as in argv

It’s a new year and I’m finally following through on my goal to learn to write mxj externals.

For my first project, I’m attempting to translate a simple applet that run on the command line into an external. It takes two text files as arguments and parses them with different functions like this:

public static void main( String[] argv ) {
char[] input = readInputFile( argv[0] );
String[][] foo = readFooFile( argv[1] );
runFoo(input, foo);
}

For some reason, I didn’t find anything in the documentation about how to load files with the standard pop-up window as variables (like “read” in jit.qt.movie). Can someone please point me to something like the above code, but done the mxj way?

Thanks,
Zach

#41538
Jan 3, 2009 at 9:39pm

On 3 janv. 09, at 21:17, Zach Gold wrote:

> It’s a new year and I’m finally following through on my goal to
> learn to write mxj externals.
>
> For my first project, I’m attempting to translate a simple applet
> that run on the command line into an external. It takes two text
> files as arguments and parses them with different functions like this:
>
> public static void main( String[] argv ) {
> char[] input = readInputFile( argv[0] );
> String[][] foo = readFooFile( argv[1] );
> runFoo(input, foo);
> }
>
> For some reason, I didn’t find anything in the documentation about
> how to load files with the standard pop-up window as variables (like
> “read” in jit.qt.movie). Can someone please point me to something
> like the above code, but done the mxj way?

You can achieve that with MaxSystem.openDialog(). If you want an
example, have a look to my ej.fplay which uses this technique.

Best,
ej

#147958

You must be logged in to reply to this topic.