Page 1 of 1

Error running script with AE7

Posted: March 23rd, 2006, 12:12 pm
by byronnash
I have a script I wrote a while back for a client. He recently switched to 7 and got an error. I've pasted the lines around the error. Did any of these methods change in 7? I don't have AE7 yet to test it unfortunately. The last line is the one that produces the error.

Code: Select all

      var time = new Date();
      var day = time.getDate();
      var month = time.getMonth()+ 1;
      var istring = month + "-" + day;
      var currFile = proj.file;
      var currFileName = "Photo Montage";
      var newFile = File(currFile.path + "/" + currFileName + "_" + istring + ".aep");

null object?

Posted: March 23rd, 2006, 6:53 pm
by redefinery
Hi Byron,

I'm not aware of any changes that would affect that code. What was the error? Was it "null is not an object"? If so, maybe the project being opened was saved in a previous version? When the project is opened in a newer version (as untitled), proj.file is null.

I noticed similar behavior in one of my scripts. I haven't checked if the same thing occurs in 6.5 when opening a 6.0 or earlier project.

Jeff

Posted: March 23rd, 2006, 7:30 pm
by byronnash
Yep, that was it. He was opening a 6.5 project in 7 and it wasn't saved. It took me a few rounds to figure that one out. Thanks for the reply Jeff.

-Byron