files less than 512 k.b
Moderator: Martin
files less than 512 k.b
hi all
is there any way to delete automatically files which are less than 512 k.b?
example
trigger = time 1.00 p.m
action = init Variable File List
expression =files less than 512 k.b
true = delete file
from record4
is there any way to delete automatically files which are less than 512 k.b?
example
trigger = time 1.00 p.m
action = init Variable File List
expression =files less than 512 k.b
true = delete file
from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: files less than 512 k.b
Enable "Include file attributes" in init Variable file list. Then use following expression. del_list will contain files lists below 512kb
Code: Select all
del_list=newList();
for (file in files)
{
if (!isDirectory(file[0]) && file[2]<512*1024)
{
addElement(del_list, file[0])
}
}
if (length(del_list)>0)
{
return true
}
else
{
return false
}
Last edited by anuraag on 09 Mar 2019 08:23, edited 1 time in total.
Re: files less than 512 k.b
hi
not working. error absolute path after selecting current path.
not working. error absolute path after selecting current path.
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: files less than 512 k.b
I have tested it. Try this flow
Last edited by anuraag on 09 Mar 2019 13:54, edited 1 time in total.
Re: files less than 512 k.b
hi anuraag
not working in my device. my device is Samsung Galaxy j2.
from record4
not working in my device. my device is Samsung Galaxy j2.
from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: files less than 512 k.b
hi
- Attachments
-
- log.txt
- (2.88 KiB) Downloaded 577 times
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: files less than 512 k.b
Code: Select all
09.03.2019 19:04:58.449 [Files less than 512kb] Start executing action 'Init Variable File List: files to /storage/emulated/0/Download'
Try this flow by deleting previous one.
- Attachments
-
- flow_Files_less_than_512kb_20190309_191930.xml
- (2.14 KiB) Downloaded 656 times
Re: files less than 512 k.b
@anuraag : The last line of the expression can be any statement that evaluate to true or false. So you can optimize the last checking a bit. Instead
I would use only
Both result the same. But of course the former is more readable.
Code: Select all
if (length(del_list)>0)
{
return true
}
else
{
return false
}
Code: Select all
length(del_list)>0
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.