Thank you very much to both of you, Fibonacci and cdbc, for your nice answers.
Brother cdbc, I tried the example you gave and it works fine.
The only problem is that the application must be running constantly to detect the folder change.
For now, what I have in mind is that the application should work whenever I want it, rather than having it open all the time.
If there is such a feature in folder attributes I'd like to know about it, otherwise I'll keep the above aside as a solution.