3 Replies Latest reply on Feb 21, 2008 1:55 AM by Kasyan Servetsky

    HIDE / SHOW active panels

    Level 1
      hallo another tweak to my tiny script...

      I know its a little foolish to be tweaking such a little nonsense script BUT hey everybody has to start somewhere and THAT'S what a forum is about :)

      I got this problem:

      Iam trying to hide all panels i have currentlly visible and later show them again as they were before... i can do it in two separate scripts (scriptHIDE, scriptSHOW) thats fine with me...

      i just need to script an exact functionality of pressing TAB key (show/hide panels)

      when i use "app.panels.everyItem().visible = false" all the panels dissapear BUT there is no way to show them back :) they are gone

      when i in contrary use "app.panels.everyItem().visible = true" InDesign shows EVERY panel possible...

      isnt there some smarter and cleaner way to toggle ON / OFF panels but only those which are currentlly visible (including Tools and Control)...
        • 1. Re: HIDE / SHOW active panels
          Kasyan Servetsky Level 5
          Hi Rosta,
          My idea is to save "visible" property of every panel in an array, and then after making every panel invisible you can restore the visible state of the panels:

          // remember which panels visible and invisible in array
          var arr = app.panels.everyItem().visible;
          // make every panel invisible
          app.panels.everyItem().visible = false;
          // restore settings from the array
          for (i=app.panels.length -1; i>=0; i--){
          app.panels[i].visible = arr[i];

          • 2. Re: HIDE / SHOW active panels
            Level 1
            Hi Rosta, Kasyan,

            It seems to me that the app.applyWorkspace() method might be a reasonable way to do this...?


            • 3. Re: HIDE / SHOW active panels
              Kasyan Servetsky Level 5
              Hi Ole,

              I quite agree with you. To use workspace was the first thought that came into my mind but I was looking for it in the properties of application; I didnt guess that it was in methods. Find workspace in OMV returns nothing, so I thought it was impossible.
              By the way, is it possible to save/delete workspace? I cant find methods for this.
              Thank you.