How to delete a file once it is created by an app? This question applies to any file created by an app, but this is the description of my problem.

I have an app installed in my phone that creates a .nomedia file in the root of my storage every time a specific action happens in the app. This causes all media files on my phone not to appear in gallery applications because the media scanner ignores everything.

I have contacted the app but they still did not have managed to solve that problem. What I want to know then is if there is a way to immediately delete the .nomedia file as soon as it is created by the app.
Monitoring a directory for a newly created or modified file is a simple task for an app as Android provides an API for doing so. 

Therefore a lot of apps include file monitoring capabilities, such as Automate or Tasker. In these apps you can monitor the file as add a trigger to delete the file that will be executed immediately when the file is created.