0 Replies Latest reply on Apr 13, 2010 7:56 AM by Loic.Aigon

    Is it possible to remove user interaction in a eventListener ?

    Loic.Aigon Adobe Community Professional



      I am working on two scripts that both need to deal with the user interaction.

      This following script works just fine. The only matter is that Indesign alerts me that the script prevented the UI dialog from opening.

      What if I don't want any alert ?


      #targetengine "newdialog"
      Application.prototype.main = function(){
           //app.addEventListener ("beforeNew", preventMe, false);
           var myMenuAction = app.menuActions.item("$ID/Document...");
           myMenuAction.addEventListener ("beforeInvoke", preventMe, false)
      function preventMe(myEvent){


      I thought about userInteractionLevel but I tried to use it recently and I couldn't get it working. My intention was to get an automated update of my modified links when opening a file.

      It's like


      couldn't be set once the script has been launched.




      #targetengine "autolinkupdate"
      function main(){
           var myMenuAction = app.menuActions.item("$ID/kPMOpenDocTextKey");
           //app.addEventListener("beforeOpen",removeInteraction, false);
           app.addEventListener("afterOpen",updatelinks, false);
      function updatelinks(myEvent){
           var doc=myEvent.parent;
           var lk = doc.links;
           for(var i=0; i<lk.length; i++){
           app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
      function removeInteraction(myEvent){
           app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;



      So my question is : Is it possible to remove user interaction in a eventListener ?