file size detection on drive

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
tlawrimore
Posts: 5
Joined: September 7th, 2007, 5:58 am
Location: Atlanta

Hello,
Animation sequences often have bad frames. Usually a good way to check a sequene is in an explorer, with the "size" column ordered. The bad frames are easy to spot because they have an unusually small file size compared to the others.

I have a nice script that checks for the existance of each frame in a selected source file, but what I can't figure out is how to access the size.

"javascript"
var fso = newActiveXObject("Scripting.FileSystemObject");
var file = fso.getFile(c:\\temp\\animation.0001.tga);
var size = file.size;
alert("File size is: " + size);


I know AE doesn't use the FSO, and I know this is an easy one, but then again, I thought changing the font style via a script would be easy.
:?

Thanks in advance.
-Todd
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

I think you just need to use the length attribute, like this:

Code: Select all

var myFile = fileGetDialog("Select file.","");
if (myFile == null){
  alert ("No file selected.");
}else{
  alert ("" + myFile.length);
}
Dan
tlawrimore
Posts: 5
Joined: September 7th, 2007, 5:58 am
Location: Atlanta

Hey Dan,
Thanks. I was hoping that was going to be an easy one.

I've now found the "bridge_javascript_ref.pdf" and it gave me more info on the file/folder object too.

Thanks for the help.
-Todd
Softimage Animator
Shaw Science Partners, Atlanta
http://www.shawscience.com
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

Glad to see you on the forum Todd, happy coding.
Post Reply