I was wondering if there's a script that checks the existence of the files in the folder. By which i mean, a script that simply checks the file is still available in the folder or not.
I move files all the time several times a day and the cataloging becomes obsolete without this feature to me (it's actually why I need a tool to keep track of which files are where now).
There is a FileExists function which takes in parameter a file path (string) and returns true or false depending if it exists or not.
So for example if your files paths are in the appropriate field, the following script run on the list will pop a message when a file does not exist:
program NewScript;
var
s: String;
begin
s := GetField(fieldFilePath);
if FileExists(s) = False then
begin
ShowMessage('File does not exist: ' + s);
end;
end.
So sorry to never have replied, my laptop was stolen and now two years later I'm stuck with the same issue.
I think I'm just really unable to comprehend the simple terms and strings.
How do I add a string to to the existing script to make it generate a txt file?
program CheckFiles;
uses
StringUtils1;
var
MovList: TStringList;
s, CurFile, CurMovie: string;
ResultPath: string;
begin
if ResultPath = '' then
begin
ResultPath := 'c:\list.txt';
Input('Check files', 'Store results to:', ResultPath);
end;
if ResultPath = '' then
begin
Error;
end;
CurMovie := GetField(fieldOriginalTitle);
CurFile := GetField(fieldFilePath);
s := CurMovie + #9 + CurTitle + #9;
if FileExists(CurFile) then
s := s + "Yes"
else
s := s + "No";
MovList.Add(s);
MovList.SaveToFile(ResultPath);
end.
(not tested)
It is not very efficient because it rewrites the list on each movie, but I don't really know the functions that soulsnake added in 4.x versions that allow to make it otherwise.