Similarity Forum
General Category => General => Topic started by: icqtoni on August 21, 2019, 14:43:26
-
Hi, I'm new here.
I know something about javascript ... but here i just can not get any further. I would like to export the quality analysis of my collection. Here I fail at this point:
var files = results.analysis.files;
for (var idx = 0; idx < files.length; ++idx) {
//var filename = "D:\\path\\file.mp3";
var filename = files[idx]; // Filename as String ???
var tmp = filename.lastIndexOf("\\");
If I manually set a string this will work.
Now it fails at lastIndexOf.
I hope I can still be helped.
Thanks in advance
icqtoni
-
Sorry for the delay.
your filename is not a string, it's special object, just get path property and it is a string.
var files = results.analysis.files;
for (var idx = 0; idx < files.length; ++idx) {
//var filename = "D:\\path\\file.mp3";
var filename = files[idx].path; // Filename as String ???
var or_get_filename = files[idx].filename; // Filename as String ???
var tmp = filename.lastIndexOf("\\");
log(filename + ': ' + tmp);
}
-
Hello Admin,
i had meanwhile recognized my mistake myself, nevertheless many thanks for your reference.
Great program that allows a real comparison of the files.
Best regards
icqtoni