The following Labtalk script will fit to either a dataset in a worksheet or a curve in a plot depending on whether a worksheet or graph is active before you execute the script.
// Fit to Nth Column in Active Worksheet, or // Fit to Nth Curve in Active Graph Window n=3; //N is Nth Col or Curve of Active Window nlsf.init(); nlsf.func$=Voigt; nlsf.fitcolnum = 1; nlsf.fitdata$=%(n,@D); //Fit Nth Column or Curve nlsf.p1=0; nlsf.p2=36; nlsf.p3=10000; nlsf.p4=10; nlsf.p5=10; nlsf.iterate(100); nlsf.end(); rescale; // The End (fsz)