Module ij
Package ij

Class Macro


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

      Fields 
      Modifier and Type Field Description
      static java.lang.String MACRO_CANCELED  
    • Constructor Summary

      Constructors 
      Constructor Description
      Macro()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void abort()
      Aborts the currently running macro or any plugin using IJ.run().
      static java.lang.String eval​(java.lang.String code)
      Evaluates 'code' and returns the output, or any error, as a String (e.g., Macro.eval("2+2") returns "4").
      static java.lang.String getDir​(java.lang.String path)  
      static java.lang.String getName​(java.lang.String path)  
      static java.lang.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.
      static java.lang.String getValue​(java.lang.String options, java.lang.String key, java.lang.String defaultValue)  
      static boolean open​(java.lang.String path)  
      static boolean saveAs​(java.lang.String path)  
      static void setOptions​(java.lang.String options)
      Define a set of Macro options for the current Thread.
      static void setOptions​(java.lang.Thread thread, java.lang.String options)
      Define a set of Macro options for a Thread.
      static java.lang.String trimKey​(java.lang.String key)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Macro

        public Macro()
    • Method Detail

      • open

        public static boolean open​(java.lang.String path)
      • saveAs

        public static boolean saveAs​(java.lang.String path)
      • getName

        public static java.lang.String getName​(java.lang.String path)
      • getDir

        public static java.lang.String getDir​(java.lang.String path)
      • abort

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

        public static java.lang.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:
        GenericDialog, OpenDialog
      • setOptions

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

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

        public static java.lang.String getValue​(java.lang.String options,
                                                java.lang.String key,
                                                java.lang.String defaultValue)
      • trimKey

        public static java.lang.String trimKey​(java.lang.String key)
      • eval

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