Is there any way I can run a script to remove from the filesystem a given list of movies movies (directories containing the movies actually)?
I've just decided to get the rid of some movies I have so it would be nice if I could e.g. select them in AMC and run a script to do so.
BTW I have The full path of the video under the field "Source".
Then I can also remove the record inside the AMC DB manually no problems...
Thanks!
script to delete specific movies from the filesystem
Hi,
Actually for now you can only delete/copy/rename files with this functions
create new text files with TStringList class and create XML files with TJvSimpleXml class.
There is no way to create/delete/copy a folder with scripts for now.
Only MoveFile function works also to rename a folder (but I think this should not be possible).
I should add the functions CreateFolder, DeleteFolder, CopyFolder, MoveFolder and change MoveFile to work only with files in the next release.
Soulsnake.
Actually for now you can only delete/copy/rename files with this functions
Code: Select all
function DeleteFile(AFileName: string): Boolean;
function CopyFile(ASourceFileName: string; ATargetFileName: string; SkipIfExists: Boolean): Boolean;
function MoveFile(ASourceFileName: string; ATargetFileName: string): Boolean;
There is no way to create/delete/copy a folder with scripts for now.
Only MoveFile function works also to rename a folder (but I think this should not be possible).
I should add the functions CreateFolder, DeleteFolder, CopyFolder, MoveFolder and change MoveFile to work only with files in the next release.
Soulsnake.
MoveFile is mapped to Windows' MoveFile function which is used for renaming and movie files and folders (I use the same one for all operations in Ant Renamer), from what I remember, so it's normal if it works.
I do not really see the point of doing two different functions which would call the same function behind
In the meantime other actions could be done using command-line (there is a Launch function, you can pass "cmd.exe /c md c:\foldername" for example)
The only problem is that you have to include a small pause after the call, to be sure that the operation is done, as the Launch function do not wait for the operation to finish before executing the next code line.
I do not really see the point of doing two different functions which would call the same function behind

In the meantime other actions could be done using command-line (there is a Launch function, you can pass "cmd.exe /c md c:\foldername" for example)
The only problem is that you have to include a small pause after the call, to be sure that the operation is done, as the Launch function do not wait for the operation to finish before executing the next code line.
Perhaps calling from the program a simple
would be enough?
Code: Select all
rmdir /s /q WHATEVERDIR
Bringing back this old topic, I've identified two scenarios:
1) records in AMC I want to delete performing also an action on the filesystem (this should be the easiest one). So present in the database AND in the filesystem. Action: delete record AND delete directory in the filesystem.
2) records in AMC pointing to reference in the filesystem (e.g. Source field) non existing any more. So present in AMC but not in the filesystem.
In the first case I think I need to work on a script to remove whatever it's in the source field and extract the directory), still perhaps an integration with the GUI would help other people performing this action.
In the second case though, I think there's a need to add a function in AMC (still GUI?) to do a sanity-check given a field e.g. Source. If source is not available ask what to do (Ignore/delete/a.s.o.)
What do you think?
1) records in AMC I want to delete performing also an action on the filesystem (this should be the easiest one). So present in the database AND in the filesystem. Action: delete record AND delete directory in the filesystem.
2) records in AMC pointing to reference in the filesystem (e.g. Source field) non existing any more. So present in AMC but not in the filesystem.
In the first case I think I need to work on a script to remove whatever it's in the source field and extract the directory), still perhaps an integration with the GUI would help other people performing this action.
In the second case though, I think there's a need to add a function in AMC (still GUI?) to do a sanity-check given a field e.g. Source. If source is not available ask what to do (Ignore/delete/a.s.o.)
What do you think?