Module ij
Package ij

Class Macro


public class Macro extends Object
The class contains static methods that perform macro operations.
  • Field Details

  • Constructor Details

    • Macro

      public Macro()
  • Method Details

    • open

      public static boolean open(String path)
    • saveAs

      public static boolean saveAs(String path)
    • getName

      public static String getName(String path)
    • getDir

      public static String getDir(String path)
    • abort

      public static void abort()
      Aborts the currently running macro or any plugin using IJ.run().
    • getOptions

      public static String getOptions()
      If a command started using run(name, options) is running, and the current thread is the same thread, returns the options string, otherwise, returns null.
      See Also:
    • setOptions

      public static void setOptions(String options)
      Define a set of Macro options for the current Thread.
    • setOptions

      public static void setOptions(Thread thread, String options)
      Define a set of Macro options for a Thread.
    • getValue

      public static String getValue(String options, String key, String defaultValue)
    • trimKey

      public static String trimKey(String key)
    • eval

      public static String eval(String code)
      Evaluates 'code' and returns the output, or any error, as a String (e.g., Macro.eval("2+2") returns "4").