0 Replies Latest reply: Nov 25, 2009 6:46 AM by Skempy RSS

    [CS4 JS] beforeExport event listener question

    Skempy Community Member

      Hi,

       

      I have created an eventlistener in a startup script which simply writes to a log file every time anything is exported.

       

          var myEventListener1 = app.addEventListener("beforeExport", exportLog);

       

           function exportLog(){
           
            myNewDate = new Date;
            myDateString = myNewDate.toString();
            myExportTime = myDateString.slice(0,-9)
                  
            var myString = app.documents[0].name + '\t' + myExportTime;
              
            myFile = File(c/Logs/export_log.txt");
            myFile.open("a");
            myFile.write(myString + '\n');
            myFile.close();

           }

       

      As you can see, I can get the time of the export and the name of the document from which the export was done.

       

      Is it possible to get the path and name of the actual file exported or does the event listener not yet know this when the event handler is run?

       

      Thanks

       

      Simon Kemp