AE ENHANCERS

Expressions/Scripts/Presets
It is currently Sat May 18, 2013 6:41 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Writing to a text file
PostPosted: Thu Nov 13, 2008 10:11 am 
Offline

Joined: Fri Nov 07, 2008 2:18 am
Posts: 4
Hi another question (sorry). How can I save a text file from after effects and choose where it is saved?

Thanks in advance


Top
 Profile  
 
 Post subject: Re: Writing to a text file
PostPosted: Thu Nov 13, 2008 11:27 am 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 645
Location: London, UK
I've done a couple of scripts that save text files which you could check out:
viewtopic.php?f=9&t=653
viewtopic.php?f=9&t=31

Let me know if you can't figure it out and I'll do you an example script when I get the time.

Paul


Top
 Profile  
 
 Post subject: Re: Writing to a text file
PostPosted: Fri Nov 14, 2008 3:32 am 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 645
Location: London, UK
Here's an example script that shows how to get AE to write a text file:
Code:
{
   // prompt to save file
   var theFile = filePutDialog("Save the text file.", "untitled.txt", "TEXT txt");
   
   // if user didn't cancel...
   if (theFile != null) {
      
      // open file for "w"riting,
      theFile.open("w","TEXT","????");
      
      // write a line in the text file
      theFile.writeln("Woohoo! I've written to a text file.");
      
      // if a comp is selected, write the name of all the layers
      activeItem = app.project.activeItem;
      if (activeItem != null && activeItem instanceof CompItem) {
         for (x = 1; x <= activeItem.numLayers; ++x) {
            theFile.writeln(activeItem.layer(x).name);
         }
      }
   
      // close the text file
      theFile.close();
      
      // open text file in default app
      theFile.execute();
   }
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group