ij.plugin
Class Macro_Runner

java.lang.Object
  extended by ij.plugin.Macro_Runner
All Implemented Interfaces:
PlugIn

public class Macro_Runner
extends java.lang.Object
implements PlugIn

Opens and runs a macro file.


Constructor Summary
Macro_Runner()
           
 
Method Summary
 void run(java.lang.String name)
          Opens and runs the specified macro file on the current thread.
 java.lang.String runJavaScript(java.lang.String script, java.lang.String arg)
          Runs a script on the current thread, passing 'arg', which the script can retrieve using the getArgument() function.
 java.lang.String runMacro(java.lang.String macro, java.lang.String arg)
          Opens and runs the specified macro on the current thread.
 java.lang.String runMacroFile(java.lang.String name, java.lang.String arg)
          Opens and runs the specified macro file on the current thread.
 java.lang.String runMacroFromIJJar(java.lang.String name, java.lang.String arg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Macro_Runner

public Macro_Runner()
Method Detail

run

public void run(java.lang.String name)
Opens and runs the specified macro file on the current thread. Displays a file open dialog if name is an empty string. Loads the macro from a JAR file in the plugins folder if name starts with "JAR:". Otherwise, loads the specified macro from the plugins folder or subfolder.

Specified by:
run in interface PlugIn

runMacroFile

public java.lang.String runMacroFile(java.lang.String name,
                                     java.lang.String arg)
Opens and runs the specified macro file on the current thread. The file is assumed to be in the macros folder unless name is a full path. ".txt" is added if name does not have an extension.


runMacro

public java.lang.String runMacro(java.lang.String macro,
                                 java.lang.String arg)
Opens and runs the specified macro on the current thread. Macros can retrieve the optional string argument by calling the getArgument() macro function. Returns the String value returned by the macro, null if the macro does not return a value, or "[aborted]" if the macro was aborted due to an error.


runMacroFromIJJar

public java.lang.String runMacroFromIJJar(java.lang.String name,
                                          java.lang.String arg)

runJavaScript

public java.lang.String runJavaScript(java.lang.String script,
                                      java.lang.String arg)
Runs a script on the current thread, passing 'arg', which the script can retrieve using the getArgument() function.