I have created a java class that contains a method that returns an array of strings:

 

    public String[] substituteTemplate (String template, Hashtable subs) throws java.io.IOException, java.io.FileNotFoundException {

            Vector v = new Vector<String>();

 

        … some code here ...

 

        String[] result = new String[v.size()];

        return result;

    }

 

I have placed the .jar file containing this class on the classpath and added it to my
beanshell script. I then try to call the method.

 

            try {

                text = substituteTemplatey(macroFile, vars);

                //Macros.message(view, text.toString());

            } catch (Exception e) {

                Macros.message(view, "Exception");

            }

 

The method appears to be called OK, but the return value can’t seem to be accessed. I get
a silent error and my script just ends. I’ve tried various things but can’t seem to access
the returned item.

 

Is there something special I have to do here? It seems pretty straightforward, but I can’t
get it to work.

 

Any suggestions?

 

Thanks,

 

-- Greg