Macros Issue for imageJ

Hi all,

I recently created a macros for imageJ that utilizes the getselectioncoordinates function. However it keeps giving me an error when I install it, saying that there is an “undefined variable in line 3, var x1 = xpoints[0]” with <> around the xpoints. Is there a way to fix this? Here are the first few lines:

macro "Auto  Rotate”{
getSelectionCoordinates(xpoints,ypoints);
var x1=xpoints[0];
var y1=ypoints[0];
var x2=xpoints[1];
var y2=ypoints[1];
var x3;
var y3;
var angle;
var dis1;
var dis2;

Thank you for your help!

Hi @Fore7630,

if you exchange the second quotation marks after the macro name it works.
The ones you had there where somohow different that the expected ones :slight_smile:

macro "Auto Rotate"{
    getSelectionCoordinates(xpoints,ypoints);
    var x1=xpoints[0];
    var y1=ypoints[0];
    var x2=xpoints[1];
    var y2=ypoints[1];
    var x3;
    var y3;
    var angle;
    var dis1;
    var dis2;