Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Attempt to use new File() in AE CS4

  • Attempt to use new File() in AE CS4

    Posted by Rob Mcgowan on February 21, 2017 at 7:47 pm

    hi, I’m new to AE and I’m trying to debug an expression in javascript but I’m finding it difficult to get feedback what the thing is doing.

    I tried the standard Javascript alert but AE says thees no such function so I tried writing to a file with new File(name). I know this is implemented because it’s in the CS3 docs, duik manages to do it and there’s a checkbox in the preferences which would be a bit silly if you couldn’t do so. Anyway it throws’ no constructor for type File’ or something like that.

    I tried write()ing to the info window but either it didn’t work or possibly the written text was overwritten by the standard UI updates as the mouse moves (the expression runs as I move stuff).

    Anyone help me? Whats a good way to get feedback from a script?
    Thanks

    var f = new File("c:\\not working.txt");
    alert("I dont work either!");
    write("what do ya know, this dont work");
    writeLn("nor this");

    Dan Ebberts replied 9 years, 2 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    February 21, 2017 at 9:16 pm

    You can use alert and write to files in AE scripting, but not expressions.

    Dan

  • Rob Mcgowan

    February 21, 2017 at 9:40 pm

    Thanks! I guess #include is out too! shame.

  • Rob Mcgowan

    February 21, 2017 at 10:40 pm

    I’m wrong… #include works for expressions. Bring on the library…

  • Dan Ebberts

    February 21, 2017 at 10:47 pm

    I believe somewhere along the line (apparently after CS4) they changed it so that #include no longer works, so I’d avoid it if you want your expressions to work in later versions.

    Dan

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