Move movies
Move movies
I wonder if there is any way using AMC you can move several selects movies to another directory in the Hdd or to another Hdd. I know that using Shift + Ctrl + M it opens the location of a file and it can be useful if you want to move one, but if you one to move 100 it will take you long time. For example copy/move all the Clint Eastwood movies to an external Hdd.
Hi,
This is a little script that I have written for me and I use now to copy some movies on an external drive with AMC 4.2.0 Beta.
To use it, it is easy, just change destPath value with the path where you want to copy selected movies.
To move movies instead of copy them, it is the same, just use this function
instead of
You can see all this functions with more details in AMC Help (F1).
Note: When the script is launch, you can not stop it and AMC will have some UI freezes but this is normal because AMC copy/move files on the same thread... Something to improve in the future
.
Soulsnake.
This is a little script that I have written for me and I use now to copy some movies on an external drive with AMC 4.2.0 Beta.
To use it, it is easy, just change destPath value with the path where you want to copy selected movies.
Code: Select all
program CopyMovies;
var
destPath: string;
srcFileName: string;
destFileName: string;
log: TStringList;
begin
if GetIteration = 0 then // Initialisation
begin
destPath := 'H:\'; // Change this value with the path where you want to copy movies
log := TStringList.Create;
end;
srcFileName := GetField(fieldFilePath);
destFileName := destPath + ExtractFileName(srcFileName);
if CopyFile(srcFileName, destFileName, True) then
log.Add('OK : ' + srcFileName + ' >> ' + destFileName)
else
log.Add('Erreur : ' + srcFileName + ' >> ' + destFileName);
if GetField(fieldDisks) = '2' then
begin
srcFileName := StringReplace2(srcFileName, 'Cd1', 'Cd2', True, False);
destFileName := destPath + ExtractFileName(srcFileName);
if CopyFile(srcFileName, destFileName, True) then
log.Add('OK : ' + srcFileName + ' >> ' + destFileName)
else
log.Add('Erreur : ' + srcFileName + ' >> ' + destFileName);
end;
if GetIteration = GetIterationCount-1 then // Finalisation
begin
ShowMemo(Log.Text);
log.Free;
end;
end.
Code: Select all
MoveFile(ASourceFileName: string; ATargetFileName: string): Boolean;
Code: Select all
function CopyFile(ASourceFileName: string; ATargetFileName: string; SkipIfExists: Boolean): Boolean;
Note: When the script is launch, you can not stop it and AMC will have some UI freezes but this is normal because AMC copy/move files on the same thread... Something to improve in the future

Soulsnake.
I have AMC 4.1.2.3 version, where can I download AMC 4.2.0 Beta?soulsnake wrote:Hi,
This is a little script that I have written for me and I use now to copy some movies on an external drive with AMC 4.2.0 Beta.
To use it, it is easy, just change destPath value with the path where you want to copy selected movies.
Soulsnake.
-
- Posts: 863
- Joined: 2006-08-31 23:58:18
here --> [FR][EN] Ant Movie Catalog 4.2.0 [BETA] (03/11/13)al203 wrote:I have AMC 4.1.2.3 version, where can I download AMC 4.2.0 Beta?
This is the script I finally use:catalpa wrote:Hi,
i try your script but it produce an error:
"Erreur : >> I:" (drive letter is ok)
May it don't work with UNC-Path
( \\server\share\file_path ) as
file location?
Thanks
program MoveMovies;
var
destPath: string;
srcFileName: string;
destFileName: string;
log: TStringList;
ResultPath: string;
begin
if ResultPath = '' then
begin
ResultPath := '---';
Input('Find Duplicates', 'Store results to:', ResultPath);
end;
if GetIteration = 0 then // Initialisation
begin
destPath := ResultPath +'\'; // Change this value with the path where you want to copy movies
log := TStringList.Create;
end;
srcFileName := GetField(fieldURL); //FilePath);
destFileName := destPath + ExtractFileName(srcFileName);
if MoveFile(srcFileName, destFileName) then
begin
log.Add('OK : ' + srcFileName + ' >> ' + destFileName);
SetField(FieldUrl, destFileName);
end
else
log.Add('Erreur : ' + srcFileName + ' >> ' + destFileName);
if GetField(fieldDisks) = '2' then
begin
srcFileName := StringReplace2(srcFileName, 'Cd1', 'Cd2', True, False);
destFileName := destPath + ExtractFileName(srcFileName);
if MoveFile(srcFileName, destFileName) then
log.Add('OK : ' + srcFileName + ' >> ' + destFileName)
else
log.Add('Erreur : ' + srcFileName + ' >> ' + destFileName);
end;
if GetIteration = GetIterationCount-1 then // Finalisation
begin
ShowMemo(Log.Text);
log.Free;
end;
end.
Last edited by al0203 on 2014-03-23 03:44:12, edited 1 time in total.
Hi :-)
i think, with your new path requester it is not necessary
to edit the code: "[...] +'\'; // Change this value with [...]"
but i still got a error :-/
"Erreur : \\SERVERPATRICK\Filme2\Movie (2013)\Movie (2013).mkv >> I:\Movie (2013).mkv"
ANT can read/write in "\\SERVERPATRICK\Filme2\", so i think
its not a permission problem, the drive I: is writable too.
Update, found the bug :-)
1.) i use "Source" for the Movie.mkv, also: GetField(fieldSource); //FilePath);
2.) i NOT wants to move! sorry, my mistake.
i want to copy like the first script! while tasting i kill the
two test movies *facepalm* and can't copy them... (logical)
i think, with your new path requester it is not necessary
to edit the code: "[...] +'\'; // Change this value with [...]"
but i still got a error :-/
"Erreur : \\SERVERPATRICK\Filme2\Movie (2013)\Movie (2013).mkv >> I:\Movie (2013).mkv"
ANT can read/write in "\\SERVERPATRICK\Filme2\", so i think
its not a permission problem, the drive I: is writable too.
Update, found the bug :-)
1.) i use "Source" for the Movie.mkv, also: GetField(fieldSource); //FilePath);
2.) i NOT wants to move! sorry, my mistake.
i want to copy like the first script! while tasting i kill the
two test movies *facepalm* and can't copy them... (logical)
This is the one I have to copy files:catalpa wrote:Hi :-)
i think, with your new path requester it is not necessary
to edit the code: "[...] +'\'; // Change this value with [...]"
but i still got a error :-/
"Erreur : \\SERVERPATRICK\Filme2\Movie (2013)\Movie (2013).mkv >> I:\Movie (2013).mkv"
ANT can read/write in "\\SERVERPATRICK\Filme2", so i think
its not a permission problem, the drive I: is writable too.
Update, found the bug :-)
1.) i use "Source" for the Movie.mkv, also: GetField(fieldSource); //FilePath);
2.) i NOT wants to move! sorry, my mistake.
i want to copy like the first script! while tasting i kill the
two test movies *facepalm* and can't copy them... (logical)
program CopyMovies;
var
destPath: string;
srcFileName: string;
destFileName: string;
log: TStringList;
ResultPath: string;
begin
if ResultPath = '' then
begin
ResultPath := '---';
Input('Find Duplicates', 'Store results to:', ResultPath);
end;
if GetIteration = 0 then // Initialisation
begin
destPath := ResultPath +'\'; // Change this value with the path where you want to copy movies
log := TStringList.Create;
end;
srcFileName := GetField(fieldURL); //FilePath);
destFileName := destPath + ExtractFileName(srcFileName);
if CopyFile(srcFileName, destFileName, True) then
log.Add('OK : ' + srcFileName + ' >> ' + destFileName)
else
log.Add('Erreur : ' + srcFileName + ' >> ' + destFileName);
if GetField(fieldDisks) = '2' then
begin
srcFileName := StringReplace2(srcFileName, 'Cd1', 'Cd2', True, False);
destFileName := destPath + ExtractFileName(srcFileName);
if CopyFile(srcFileName, destFileName, True) then
log.Add('OK : ' + srcFileName + ' >> ' + destFileName)
else
log.Add('Erreur : ' + srcFileName + ' >> ' + destFileName);
end;
if GetIteration = GetIterationCount-1 then // Finalisation
begin
ShowMemo(Log.Text);
log.Free;
end;
end.