Quantcast

Error - ';' expected in line

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error - ';' expected in line

OscarF-M
This post has NOT been accepted by the mailing list yet.
Hi,

I am fairly new to writing macros, but what this is meant to do is create a stack. The previous part of the macro simply runs a python script that takes an image and saves it to a folder then opens the latest image in that folder. So each time an image is take I want it added to the stack.

This code works, but on opening the first image and running this I get the error ';' expected in line 8

If I close the error and continue to take and open new images then it runs fine adding them to the stack without any errors.

list = getList("image.titles");
  if (list.length == 0) {
  print("No image windows are open");
  } else if (list.length == 1) {
  print("open another image");
  } else (list.length == 2) {
  if (list[0] == "Stack") {
  run("Concatenate...", "  title=[Stack] image1=Stack image2=" +list[1]+ " image3=[-- None --]");
  } else if (list[1] == "Stack") {
  run("Concatenate...", "  title=[Stack] image1=Stack image2="+list[0]+" image3=[-- None --]");
  } else{
  run("Images to Stack", "method=[Copy (center)] name=Stack title=[] use");
  }
  }
Loading...