Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Scripting date Modified or creation

  • Scripting date Modified or creation

    Posted by Davis Lindsay on July 2, 2013 at 3:00 pm

    Hello,
    I’m swinging in the dark a bit for this one…

    Is it possible to use a .lastModified method with extended script?
    Or would it be easier to generate a txt file then link to that?

    my current code is giving me an “invalid date” error.
    In the alert it displays
    ,Invalid Date,[file path]

    var proj = app.project;
    var comp = proj.item(2);
    var movFolder = app.project.item(3)
    var movs = app.project.item(3).numItems;
    var newSource = movFolder.item(1);

    var fso, f, s;
    f = File("/slate script/projects"+newSource.name);
    var lastModifiedDate = new Date(newSource.lastModified);
    fso = newSource.lastModified;
    alert([fso, lastModifiedDate, f])

    Davis Lindsay replied 12 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 2, 2013 at 5:54 pm

    A few things– you could verify your path is correct by adding

    if (f.exists) alert(“File exists.”);

    after your definition of f.

    Also, I think the attribute you want is “modified”.

    You also might need to escape(newSoure.name) before you add it into the path.

    Dan

  • Davis Lindsay

    July 2, 2013 at 11:26 pm

    Wow, that was so easy;

    Tunnel vision totally had me there.

    Thanks Dan

    var proj = app.project;
    var comp = proj.item(2);
    var movFolder = app.project.item(3)
    var movs = app.project.item(3).numItems;
    var newSource = movFolder.item(1);
    var fso, f, s;
    f = File("/slate script/projects/"+newSource.name);
    var lastModifiedDate = new Date(f.created);

    if (f.exists) alert("File exists.");

    alert([lastModifiedDate, f])

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy