Loading ...
Sorry, an error occurred while loading the content.

23319Re: Document tab organization

Expand Messages
  • flo.gehrke
    Oct 27, 2012
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
      >
      > ...I'd really like to just control the order of the tabs without
      > having to close and reopen files in the wanted order.
      > Is that even possible?

      Hi John,

      If you want to re-arrange the order of tabs with a clip then, IMHO, there's no other way than to save the names, close all files, and re-open them in alphabetical order, for example.

      Here's just a basic clip that could achieve this for me (designed for Ntb 7.1):


      ^!Set %Nr%=0

      :Loop
      ^!Inc %Nr%
      ^!If ^%Nr% > ^$GetDocCount$ Sort
      ^!Set %Name%=^$GetFileName(^$GetDocName(^%Nr%)$)$
      ^!Append %Files%=^%Name%^%NL%
      ^!Goto Loop

      :Sort
      ^!Close All
      ^!Set %Files%=^$StrSort("^%Files%";0;1;0)$
      ^!Set %Files%=^$StrReplace("\R+\Z";"";"^%Files%";RA)$
      ^!Set %Files%=^$StrReplace("^|$";"\x22";"^%Files%";RA)$
      ^!Set %Files%=^$StrReplace("\R";";";"^%Files%";RA)$
      ^!Open "^%Files%"
      ^!ClearVariables


      Probably, there are more details that need to be resolved -- like focussing a particular document after re-opening. There certainly are solutions for that...

      > Maybe I'm being tricked by the the 'screenupdate off' command,...

      If you '^!Close' a document while '^!SetScreenUpdate Off' is set, then it vanishes from the screen only at end of clip. To avoid this, you have to set '^!SetScreenUpdate On' in between, close the document, and set screen update back to "Off" if necessary.


      Regards,
      Flo
    • Show all 9 messages in this topic