import static java.awt.Toolkit.*
-def curviewport = Jalview.getAlignFrames()[Jalview.getAlignFrames().length-1].getViewport();
+def curviewport = Jalview.getCurrentAlignFrame().getViewport();
// TSV output by default.
// change "\t" to "," to output CSV file