Page 1 of 1

script for verify the File Path?

Posted: 2013-09-28 09:58:15
by otreux
There is a way for verity if all the File Path are correct?
Thanks

Posted: 2013-09-28 10:20:20
by antp
There are "FileExists" and "DirectoryExists" function, at least in version 4.2 beta (not sure since when they exist).

Posted: 2013-09-28 14:21:20
by otreux
I use the 4.2 beta, where I can find those command?
Thanks

Posted: 2013-09-28 15:25:33
by soulsnake
All the functions for scripting are described in AMC Help (F1).

Here the script to check and list movies whose file path does not exist :

Code: Select all

program CheckFilePath;
var
  Path: string;
  List: TStringList;
begin
  if GetIteration = 0 then
  begin
    List := TStringList.Create;
  end;

  Path := GetField(fieldFilePath);
  if not FileExists(Path) and not DirectoryExists(Path) then
  begin
    List.Add('  - ' + GetField(fieldFormattedTitle) + ' : ' + Path)
  end;
  
  if GetIteration = GetIterationCount-1 then
  begin
    ShowMemo('List of movies whose file path does not exist:' + #10 + List.Text);
    List.Free;
  end;
end.
Soulsnake.

Posted: 2013-09-28 22:09:08
by otreux
thank you, very kind as always :)