5 Replies Latest reply on Apr 26, 2009 10:12 PM by sudar1983_14

    EventListener for beforeimport Javascript (CS3)

    sudar1983_14 Level 2

      Hi All,


      This is the code which i have copied from help document, but it is not working.


      #targetengine "session"


      function main(){

      var myApplicationEventListener = app.eventListeners.add("beforeImport",

      myEventInfo, false);

      var myDocumentEventListener = app.documents.item(0).eventListeners.add

      ("beforeImport", myEventInfo, false);


      function myEventInfo(myEvent){

      var myString = "Current Target: " + myEvent.currentTarget.name;




      I have placed this script to startup scripts folder, when it get active there was no document opened, so it shows error. How can i write a script for "beforeImport"?