4 Replies Latest reply on Apr 12, 2014 12:44 AM by Jump_Over

    Show Text Thread in all opened Document

    creativejoan0425 Level 1

      I want to show text thread in all opended Documents, here is my script, but have error, anyone can fix?

       

      var myEnableTextThreads = app.menuActions.itemByID(24332);

      var myEnableTextThreads1 = app.menuActions.item("Hide Text Threads");

      var myEnableTextThreads2 = app.menuActions.item("Show Text Threads");

       

      ShowThreads();

       

      function ShowThreads(){

      var myDoc = app.documents;

      for (var i=0; i<myDoc.length; i++) {

      if (myDoc[i].menuActions.item("Show Text Threads") == true){

                 myEnableTextThreads.invoke();

                   alert("Text Threads Shown");

                   }

               }

        • 1. Re: Show Text Thread in all opened Document
          Jump_Over Level 5

          Hi,

           

          No such property is exposed for scripting, unfortunately.

          The one to observe is a menuAction.name ==> but this is only an effect of some procedure involved by menuAction. Even worse ==> script will show you the last menuAction status - not the one is currently applied to activeDocument. It will update after menu activation in UI, not earlier.

           

          So you can only toggle between both of them regardless on its current state, using app.menuActions.itemByID(24332).

          If you will try to check (by script) its current menuAction.name ==> sometimes is true, sometimes is false.

          If you will check it manually ==. is true cause is updated already.

           

          Jarek

          • 2. Re: Show Text Thread in all opened Document
            screenName

            Hi,

             

            I found that the script is showing the last menuAction.name but not the activeDocument's menuAction.name.

             

            Do you know how can we update the menuAction in script?

            • 3. Re: Show Text Thread in all opened Document
              creativejoan0425 Level 1

              Yes I also found that, I think thats a bug, need to manually click the show texr thread again, the name can update

               

               

              從三星手機發送

              • 4. Re: Show Text Thread in all opened Document
                Jump_Over Level 5

                Hi,

                 

                Property is hidden for scripting and this could we call as oversight (not the first) rather than bug.

                MenuAction name is updated while displaying and this is correct, I guess (for UI user). Its parent is application. MenuAction can invoke some set of actions depending on values of some properties (vary for each document).

                Script can talk with InDesign about many document's but only one application at the time. So hidding a doc.property for scripting shut it down.

                Only way is simulating UI actions but there is many limitations for this.

                Plug-in developers can go deeper, I think, but they talk in another language...

                 

                Jarek