Takser delete Profile is not working

24 views
Skip to first unread message

coralwo...@gmail.com

unread,
Jan 31, 2026, 9:34:16 AM (2 days ago) Jan 31
to Tasker
Hello World,

For the life of me I do not understand why the following Task is not working:

Task: Delete WhatsApp AI Media Files - Project
   
    A1: List Files [
         Directory: Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Images/Test for Delete Script
         Include Hidden Files: On
         Sort Select: Alphabetic
         Variable Array: %files
         Continue Task After Error:On ]
   
    A2: For [
         Variable: %file_item
         Items: %files(#) ]
   
        A3: Delete File [
             File: %file_item
             Shred Level: 0
             Continue Task After Error:On ]
   
    A4: End For
   
    A5: Flash [
         Text: Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Images/Sample Files to use for test
         Tasker Layout: On
         Continue Task Immediately: On
         Dismiss On Click: On ]

It supposed to delete files in a directory as noted in A1.  Any assistance on how to possibly resolve the issue will be greatly appreciated.

Thank you!
Screenshot_20260131_092332_Tasker.jpg
Message has been deleted

SDS

unread,
Feb 1, 2026, 2:47:43 AM (yesterday) Feb 1
to Tasker
The for loop is incorrect.
correct:
The for loop is Incorrect.
Correct: 
A2: For [
         Variable: %num
         Items: 1:%files(#) ]
   
        A3: Delete File [
             File: %files(%num)

             Shred Level: 0
             Continue Task After Error:On ]
   
    A4: End For

coralwo...@gmail.com

unread,
Feb 1, 2026, 9:21:16 AM (18 hours ago) Feb 1
to Tasker
Hello SDS, 

Thanks for the sharp eyes, your corrections worked. Do you know or can point me in the direction where I can build on the Task to delete files in sub directories? Thanks again for your assistance. 

SDS

unread,
12:27 AM (3 hours ago) 12:27 AM
to Tasker
Whether it's a directory or a subdirectory, use its file path in the list file action. If you are asking about distinguishing subdirectories from files during deletion, you can use action->file->test file->type. 
Reply all
Reply to author
Forward
0 new messages