Delete a file which contains a particular piece of text in its name

Hi!
I want to delete any file in the ‘Download’ folder which contains .temp in its name.
For example, if there is a file named Image1.temp in the ‘Download’ folder, then I want to delete that file. I took a glance at different blocks included in Taifun’s File extension but nothing struck my mind to solve this purpose.
How can I achieve this?
Please kindly help me.

Thanks!

blocks

Is “.temp” the extension of your files or is it included in the NAMES?

1 Like

.temp is the extension of the file.
Thank you so much @HeyAveHey.
Seeing your blocks, I got an idea of how to do it and solved my purpose using this:

As in my case, only one file with the extension .temp can be there at a time, it’s certain that FileList will contain only one item, which will definitely be at index 1.

Thanks to @Taifun as well for this wonderful extension! (App Inventor Extensions: File | Pura Vida Apps)

Thanks again for helping. :grinning:
Have a great time!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.