Page 1 of 1
include the value of the size of each file
Posted: 17 Dec 2015 23:13
by adisaputra
> Hello.. just little Question.
> <datem yyyy.mm.dd> result: 2015.12.18
> Can you help me, i want include the value of the size of each file : 2015.12.18_563128_bytes.
>
> Thanks.
Re: include the value of the size of each file
Posted: 18 Dec 2015 00:27
by highend
Code: Select all
$list = "";
foreach($file, <get SelectedItemsPathNames |>) {
$props = "<datem yyyy.mm.dd>_" . property("size", $file) . "_bytes";
$list = $list . $file . " - " . $props . <crlf>;
}
text $list;
Something like this?
Re: include the value of the size of each file
Posted: 18 Dec 2015 04:00
by adisaputra
highend wrote:Code: Select all
$list = "";
foreach($file, <get SelectedItemsPathNames |>) {
$props = "<datem yyyy.mm.dd>_" . property("size", $file) . "_bytes";
$list = $list . $file . " - " . $props . <crlf>;
}
text $list;
Something like this?
Sorry my explanation less, I want to change the name of each file to be 2015.12.18_563128_bytes
Can you help me if i for this?
Re: include the value of the size of each file
Posted: 18 Dec 2015 06:31
by bdeshi
select the files to rename and then run this script. (You can just paste this into the addressbar then press ENTER)
Code: Select all
::foreach($f, <selitems |>){ renameitem( formatdate(property('System.DateModified',$f), 'yyyy.dd.mm').'_'.filesize($f).'_bytes', $f, 1+4 ); };
edit: was using the creation date, instead of modification.
Re: include the value of the size of each file
Posted: 18 Dec 2015 08:05
by adisaputra
SammaySarkar wrote:select the files to rename and then run this script. (You can just paste this into the addressbar then press ENTER)
Code: Select all
::foreach($f, <selitems |>){ renameitem( formatdate(property('System.DateCreated',$f), 'yyyy.dd.mm').'_'.filesize($f).'_bytes', $f, 1+4 ); };
SammaySarkar, thanks for your help.
Can you help me again, i want rename each file to : 2015.12.18_16.10.32.123_563128_bytes.
NOTE:
2015.12.18 is date
16.10.32.123 is time with millisecond
563128_bytes is size of file.
Please help me again. Thanks SammaySarkar..

Re: include the value of the size of each file
Posted: 18 Dec 2015 09:47
by bdeshi
Then use this.
Code: Select all
::foreach($f, <selitems |>){ renameitem(report('{Modified yyyy.mm.dd_hh.nn.ss.fff}', $f).'_'.filesize($f).'_bytes', $f, 5); };
Re: include the value of the size of each file
Posted: 18 Dec 2015 10:49
by adisaputra
SammaySarkar wrote:Then use this.
Code: Select all
::foreach($f, <selitems |>){ renameitem(report('{Modified yyyy.mm.dd_hh.nn.ss.fff}', $f).'_'.filesize($f).'_bytes', $f, 5); };
THANK YOU VERY MUCH.. SammaySarkar
