Copy link to clipboard
Copied
I have created a script to export metadata using the XMP Script Library. I am able to get all the properties I need except one: image file size (not dimensions, but the size of the file itself in MB). File size is not included in any XMP namespaces and it isn't in any TIFF tags as far as I can tell.
Getting the file name is very straightforward: exportFile.write (thumb.name), but I can't find any method to get the file size.
Any ideas would be a big help.
Thanks in advance,
Greg Reser
Copy link to clipboard
Copied
var sels = app.document.selections;
alert(sels[0].spec.length);
This will get you the file size in bytes, then you can divide to get Mbytes.
Copy link to clipboard
Copied
or…
var sels = app.document.selections;
alert( sels[0].core.immediate.size );
Copy link to clipboard
Copied
Paul and Mark,
Thank you! Both methods work perfectly!
Greg