Page 1 of 1

How to delete a file only if the new file is a movie/audio?

PostPosted: Tue Feb 04, 2025 7:34 pm
by ranges_brevets
I’m trying to create automation on a folder. The goal is automate an FFMPEG script that takes audio.wav and video.mov and turns them into one file.

I want to drag a video or audio file into a folder and then automatically it will rename it to audio.wav or video.mov depending on the file type. If audio.wav or video.mov already exists, I want it to be deleted/overwritten.

This is a stumbling block for me because the way I have it set up, it always deletes audio.wav even if only a video file has been added. And the FFMPEG script needs both

How do I make it check if an audio file has been added and make it keep the video file. And vice versa?

Re: How to delete a file only if the new file is a movie/aud

PostPosted: Wed Feb 05, 2025 11:22 am
by Mr_Noodle
You can try using a nested condition. For example:
Code: Select all
   if (all) are met
       Full name is video.mov
       If (all) are met for (any file or folder in the same folder)
           Full name is audio.wav

That matches a video.mov file if an audio.wav file also exists in the same folder. You'll have to tweak it for your specific needs.

Re: How to delete a file only if the new file is a movie/aud

PostPosted: Wed Feb 05, 2025 4:48 pm
by ranges_brevets
Mr_Noodle wrote:You can try using a nested condition. For example:
Code: Select all
   if (all) are met
       Full name is video.mov
       If (all) are met for (any file or folder in the same folder)
           Full name is audio.wav

That matches a video.mov file if an audio.wav file also exists in the same folder. You'll have to tweak it for your specific needs.


Thanks! That helps

Now I'm wondering how to make it work if I copy multiple files at the same time. How can I make it process one file, finish it, then move on to the next one?

Re: How to delete a file only if the new file is a movie/aud

PostPosted: Thu Feb 06, 2025 10:03 am
by Mr_Noodle
All rules only operate on a file at a time.