// "StartupMacros"
// The macros and macro tools in this file ("StartupMacros.txt") are 
// automatically installed in the Plugins>Macros submenu and
//  in the tool bar when ImageJ starts up.

//  About the drawing tools.
//
//  This is a set of drawing tools similar to the pencil, paintbrush, 
//  eraser and flood fill (paint bucket) tools in NIH Image. The 
//  pencil and paintbrush draw in the current foreground color 
//  and the eraser draws in the current background color. The
//  flood fill tool fills the selected area using the foreground color.
//  Hold down the alt key to have the pencil and paintbrush draw 
//  using the background color or to have the flood fill tool fill 
//  using the background color. Set the foreground and background 
//  colors by double-clicking on the flood fill tool or on the eye  
//  dropper tool.  Double-click on the pencil, paintbrush or eraser 
//  tool  to set the drawing width for that tool.
//
// Icons contributed by Tony Collins.

 
  var xx = requires138b(); // check version at install
  function requires138b() {requires("1.38b"); return 0; }

macro "Unused Tool- Cf60" { } // display an empty box
macro "Photometry Action Tool- Cf00o22ffC88fo44ccCccfo5599C00fT00141T80142Tf0143C44fo7744" {
        run("Photometer");
   }

macro "Clear Photometry Action Tool- Cf00o22ffC88fo44ccCccfo5599C44fo7744Cf60T4016-" {
       run("ClearPhotometer");
   }

macro "Photometry Settings Action Tool- Cf00o22ffC88fo44ccCccfo5599C44fo7744Cf60T4016+" {
       run("PhotometrySettings");
   }

macro "Unused Tool- Cf60" { } // display an empty box
macro "Abort Macro or Plugin (or press Esc key) Action Tool - CbooP51b1f5fbbf5f1b15510T5c10X" {
      setKeyDown("Esc");
  }

macro "Unused Tool- Cf60" { } // display an empty box
macro "Unused Tool- Cf60" { } // display an empty box
macro "Unused Tool -" {} // display a box with a + icon

macro "-" {} //menu divider
macro "Close all images windows" {
       path = getDirectory("macros")+"Close_All_Windows.txt";
       if (!File.exists(path))
           exit("\"Close_All_Windows.txt\" not found in SalsaJ.");
       runMacro("Close_All_Windows");
   }

macro "-" {} //menu divider
macro "Extrasolar Planet Transit exercise" {
       path = getDirectory("macros")+"MacroTransit.txt";
       if (!File.exists(path))
           exit("\"MacroTransit.txt\" not found in SalsaJ.");
       runMacro("MacroTransit");
   }


macro "Radial Velocity method (animation)" {
       path = getDirectory("macros")+"/MacroRadialVel.txt";
       if (!File.exists(path))
           exit("\"MacroRadialVel.txt\" not found");
       runMacro("MacroRadialVel");
   }

macro "Exploration of the Moon" {
       path = getDirectory("macros")+"MacroMoon.txt";
       if (!File.exists(path))
           exit("\"MacroMoon.txt\" not found.");
       runMacro("MacroMoon");
}

macro "Circumstellar Disk around Beta Pictoris" {
       path = getDirectory("macros")+"MacroBetaPic.txt";
       if (!File.exists(path))
           exit("\"MacroBetaPic.txt\" not found.");
       runMacro("MacroBetaPic");
}

macro "Study of SNIa in NGC691" {
       path = getDirectory("macros")+"MacroSNIa.txt";
       if (!File.exists(path))
           exit("\"MacroSNIa.txt\" not found.");
       runMacro("MacroSNIa");
}

macro "Sun4All" {
       path = getDirectory("macros")+"MacroSun4All.txt";
       if (!File.exists(path))
           exit("\"MacroSun4All.txt\" not found.");
       runMacro("MacroSun4All");
}

macro "Black Hole (animation)" {
       path = getDirectory("macros")+"MacroBH.txt";
       if (!File.exists(path))
           exit("\"MacroBH.txt\" not found in SalsaJ.");
       runMacro("MacroBH");
   }

macro "Detection of Dark Matter (NGC7083)" {
       path = getDirectory("macros")+"MacroNGC7083.txt";
       if (!File.exists(path))
           exit("\"MacroNGC7083.txt\" not found in SalsaJ.");
       runMacro("MacroNGC7083");
   }

macro "Craters of the Solar System" {
       path = getDirectory("macros")+"MacroCraters.txt";
       if (!File.exists(path))
           exit("\"MacroCraters.txt\" not found in SalsaJ.");
       runMacro("MacroCraters");
   }

macro "Study of the Hydrogen gas of the MilkyWay" {
       path = getDirectory("macros")+"MacroSRT.txt";
       if (!File.exists(path))
           exit("\"MacroSRT.txt\" not found in SalsaJ.");
       runMacro("MacroSRT");
   }

//macro "Extraction of small portion of the Corot-2b images" {
//       path = getDirectory("macros")+"myextract_corot-2b.txt";
//       if (!File.exists(path))
//           exit("\"myextract_corot-2b.txt\" not found");
//       runMacro("myextract_corot-2b");
//   }

//macro "Extraction of small portion of the WASP-19b images" {
//       path = getDirectory("macros")+"myextract_wasp-19b.txt";
//       if (!File.exists(path))
//           exit("\"myextract_wasp-19b.txt\" not found");
//       runMacro("myextract_wasp-19b");
//   }
 
//macro "Exploitation of the Corot-2b images" {
//       path = getDirectory("macros")+"MacroCorot-2b.txt";
//       if (!File.exists(path))
//           exit("\"MacroCorot-2b.txt\" not found");
//       runMacro("MacroCorot-2b");
//   }

//macro "Exploitation of the WASP-19b images" {
//       path = getDirectory("macros")+"MacroWASP-19b.txt";
//       if (!File.exists(path))
//           exit("\"MacroWASP-19b.txt\" not found");
//       runMacro("MacroWASP-19b");
//   }


macro "-" {} //menu divider
macro "About Startup Macros..." {
       path = getDirectory("macros")+"/AboutStartupMacros.txt";
       if (!File.exists(path))
           exit("\"About Startup Macros\" not found in ImageJ/macros/.");
       open(path);
   }

  macro "Popup Menu" {
      cmd = getArgument();
      if (cmd=="Help...")
           showMessage("About Popup Menu",
               "To customize this menu, edit the line that starts with\n\"var pmCmds\" in macros/StartupMacros.txt");
      else
          run(cmd);
  }



