4 Replies Latest reply on Dec 2, 2016 10:58 AM by 0123456789055982523

    Making an event listener work (InDesign CC Windows 8).

    JADarnell Level 1

      Hello everyone.


      I am tryingn to figure out how to make eventListeners work and something is just not clicking.


      I wrote this very simple script that looks like this:




      function main()


          app.eventListeners.add("afterSelectionChanged", myEventHandler);



      function myEventHandler(myEvent)


          alert("Something was selected", "Selection change");



      When I run this script through ExtendScript and then go to the document and select a rectangle, I get the following error message twice:


      "The requested action could not be completed because the object no longer exists."


      I attempted to run it through the scripts panel to see if that made any difference, but when I attempted to save the file Windows told me that I need to contact the administrator to get permission to write in the Scripts Panel folder.  I'm working on that while I wait for any answer that might come forth.