Adjustable overlayed rectangles from user input

Hi i am not a programmer i’m trying to make a tool that will make my job easier hope you can help me.
here is the code that i made

{getSelectionCoordinates(xc, yc);
  leftx=99999; topy=99999; rightx=0; bottomy=0;
  for (i=0; i<xc.length; i++) {
      x=xc[i]; y=yc[i];
      if (x<leftx) {leftx = x; lefty = y; }
      if (y<topy) {topy = y; topx = x; }
      if (x>rightx) {rightx = x; righty = y; }
      if (y>bottomy) {bottomy = y; bottomx = x; }
print(topx+","+ topy+","+bottomx -topx+","+(bottomy-1)-topy);
String.append(topx+","+ topy+","+bottomx -topx+","+(bottomy-1)-topy);

what this codes does is it gets coordinates from user and makes rectangles from the coordinates inputted by the user.
what i wanted is to be able to get multiple input from user like a table with coordinates inside it and then ill just paste it all at once in ImageJ to display the rectangles on the image that is opened.

can anyone help me or lead me how to make it possible? thanks in advance!

2nd problem

is it possible to edit multiple the sizes of the overlayed rectangles? in relation to the first problem once the user for example inputs 10 rectangle coordinates. is there a macro or command that will make it possible to adjust the sizes of those rectangle using a cursor? thanks alot for your ideas and help in advance!