# Add textfile to the log

**URL:** https://www.finalbuilder.com/forums/t/add-textfile-to-the-log/711
**Category:** Discussion
**Created:** [January 11, 2008, 9:51am UTC](https://www.finalbuilder.com/forums/t/add-textfile-to-the-log/711 "2008-01-11T09:51:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [January 11, 2008, 9:51am UTC](https://www.finalbuilder.com/forums/t/add-textfile-to-the-log/711/1 "2008-01-11T09:51:46Z")

</div>

Is it possible to find the newest textfile in a directory and then dump that to the FB log?

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [January 14, 2008, 12:26pm UTC](https://www.finalbuilder.com/forums/t/add-textfile-to-the-log/711/2 "2008-01-14T12:26:22Z")

</div>

Hi Roland,   
  
 Some of that is easy, and some is more difficult. The hard bit is to find the newest text file - for this you’ll have to write some VBScript or JScript, and then set a variable with the name of the file. Then, to read the text file use the “Read Text File” action (putting the contents into a variable, eg. %MyFileContents%), and then in the AfterAction script of that action, just send the contents of that variable to the log, eg. Action.SendLogMessage(MyFileContents) - note that in script you don’t enclose variables with %'s.   
  
 hth.   
 .t8

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [January 14, 2008, 7:06am UTC](https://www.finalbuilder.com/forums/t/add-textfile-to-the-log/711/3 "2008-01-14T07:06:52Z")

</div>

Ok, thanks for the answer. I will try that.   
  
 /Roland
