Debugging the the script
Use OnRunLine. For example:
procedure TForm1.OnRunLine(Sender: TfsScript; const UnitName, SourcePos: String);
var
pt: TPoint;
begin
// locate the unit with UnitName name
...
// locate the line with pt.Y number
pt := fsPosToPoint(SourcePos);
FStopped := True;
while FStopped do
Application.ProcessMessages;
end;
Examine the demo located in the DEMOS\Main folder.