Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Writing “Alert” to Text File

  • Writing “Alert” to Text File

    Posted by Ben Christie on December 3, 2015 at 7:41 pm

    Hey guys,

    So currently I have a script working pretty well that pops up an alert within after effects with my results.

    What I’m looking to do is keep that as it currently is but now add another button that the user could click to write that same “alert” information to a text file on the desktop.

    I’m having trouble making the connection of how to do that.

    Suggestions?

    Thanks!

    Ben Christie replied 10 years, 5 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    December 3, 2015 at 8:36 pm

    This should help:

    var myFileName = “Example.txt”;
    var myFilePath = “~/desktop/” + escape(myFileName);
    var myMessage = “Hello world!”;
    var myFile = new File(myFilePath);
    myFile.open(“w”);
    myFile.write(myMessage);
    myFile.close();

    Dan

  • Ben Christie

    December 9, 2015 at 12:11 am

    Dan,

    This is exactly what I’m looking for!!!

    Is there a way to name the text file your AE project title automatically instead of example?

    Would I use the following code somehow?

    Thanks!

    myProjName = app.project.item(index).name;

  • Ben Christie

    December 9, 2015 at 12:27 am

    Hey Dan,

    Also this is similar question in relation to the alert that you might be able to help with.

    I have the following code that works really well at getting the information from my function but it keeps over writing the file with the new keyframe if I have five keyframes. If I have one it works well but if I have multiple they over write each other. I’m sure it’s because of the way I am calling the information from my function but I’m not sure how to fix it.

    Any help would be great. Thanks!

    var myFileName = "example.txt";
    var myFilePath = "~/desktop/" + escape(myFileName);
    var myMessage = "keyframe: " + i +" Cubic-bezier["+x1r+", "+y1r +", "+x2r+", "+y2r +"]";
    var myFile = new File(myFilePath);
    myFile.open("w");
    myFile.write(myMessage);
    myFile.close();

  • Ben Christie

    December 9, 2015 at 12:46 am

    Shoot I’m pretty sure it has to do with the fact that I’m looping a script to get each keyframes curve, and the keyframe is called “i” each time so it just overwrites itself.

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