OK I found the problem, you need to add "uses Classes; " to the top of the script file
When using the new version (1.5) I get the following error on compilation:
Unknown identifier or variable is not declared: ‘TStringList’.
The line that corresponds with this code is:
T:= TStringList.Create;
This error does not occur with the previous version.
The full procedure is below:
procedure SaveFile(SaveAs: boolean);
var
SF, S: String;
T: TStringList;
begin
// Retrieves the data saved by the JavaScript.
S := GetGlobalVar(“datatosave”, “”);
//if S = “” then exit;
// Asks for filename
SF := GetGlobalVar(“currentfilename”, “”);
if (SF = “”) or (SaveAs = true) then SF := SaveFileDialog(“Save As”, “File1.g5s”, “.g5s", "Group 5 Subcontractor Files (.g5s)|*.g5s”, “” );
if SF = “” then exit; // User cancelled.
// Saves to a file
T:= TStringList.Create;
T.Text := S;
T.SaveToFile(SF);
T.Free;
SetGlobalVar(“currentfilename”, SF, false);
end;