Save & Exit function does not work in Willspo template
Posted: 2004-08-07 16:33:58
Hi,
I got a problem with the Save & Exit function in the Willspo MovieList template as it raises a script error. here is the script that deal with this stuff:
Is there something wring with this code? Is there something I have to do so that it can manipulate the files?
I got a problem with the Save & Exit function in the Willspo MovieList template as it raises a script error. here is the script that deal with this stuff:
Code: Select all
function exit() {
if (needToSave) {
var fso = new ActiveXObject("Scripting.FileSystemObject");
var orgFile = fso.GetFile(sourceFile);
if (fso.FileExists("Backup/" + orgFile.Name)) {
var tempFile = fso.GetFile("Backup/" + orgFile.Name);
if (tempFile != null) {
tempFile.Delete();
}
}
orgFile.Copy("Backup/" + orgFile.Name);
srcXML.save(sourceFile);
}
window.close();
}