Forums > Java

loading files as in argv

January 3, 2009 | 8:17 pm

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


January 3, 2009 | 9:39 pm

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


Viewing 2 posts - 1 through 2 (of 2 total)