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

Re: Document tab organization

Expand Messages
  • flo.gehrke
    ... 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
    Message 1 of 9 , 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
    • John Shotsky
      Thanks Flo, that at least tells me that I ve been doing it correcty in the past. I actually create a file named dummy that I open while I close the others,
      Message 2 of 9 , Oct 27, 2012
      • 0 Attachment
        Thanks Flo, that at least tells me that I've been doing it correcty in the past. I actually create a file named 'dummy'
        that I open while I close the others, then I open them in the proper order, and destroy dummy. It works, but it feels
        kludgy. I tried playing with screenupdate and StatusClose and walking through with debug on, and sometimes the closed
        file tab simply stays in place. Fortunately, when the clip ends, everything is in the correct order, but it just feels
        like something is not working right when I can't see a file close when told to close when stepping through manually.

        Regards,
        John
        RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/

        From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of flo.gehrke
        Sent: Saturday, October 27, 2012 11:49
        To: ntb-clips@yahoogroups.com
        Subject: [Clip] Re: Document tab organization


        --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.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



        [Non-text portions of this message have been removed]
      • Ian NTnerd
        John, Not knowing what you are doing, makes this a shot in the dark. For most of my processing I read a file into an array. Then if wanted, write it out to a
        Message 3 of 9 , Oct 28, 2012
        • 0 Attachment
          John,

          Not knowing what you are doing, makes this a shot in the dark.

          For most of my processing I read a file into an array. Then if wanted,
          write it out to a file as each line is processed. It is more predictable
          than working on open files. But there is less RegEx options available
          doing it this way, it will be slower at times. With this method you know
          where everything should be put and just append it to the end of the file
          it belongs to.

          It may not suit.

          Ian

          On 28/10/2012 4:40 AM, John Shotsky wrote:
          > Thanks Flo, that at least tells me that I've been doing it correcty in the past. I actually create a file named 'dummy'
          > that I open while I close the others, then I open them in the proper order, and destroy dummy. It works, but it feels
          > kludgy. I tried playing with screenupdate and StatusClose and walking through with debug on, and sometimes the closed
          > file tab simply stays in place. Fortunately, when the clip ends, everything is in the correct order, but it just feels
          > like something is not working right when I can't see a file close when told to close when stepping through manually.
          >
          > Regards,
          > John
          > RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/
          >
          > From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of flo.gehrke
          > Sent: Saturday, October 27, 2012 11:49
          > To: ntb-clips@yahoogroups.com
          > Subject: [Clip] Re: Document tab organization
          >
          >
          > --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.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
          >
          >
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >
          > ------------------------------------
          >
          > Fookes Software: http://www.fookes.com/
          > NoteTab website: http://www.notetab.com/
          > NoteTab Discussion Lists: http://www.notetab.com/groups.php
          >
          > ***
          > Yahoo! Groups Links
          >
          >
          >
          >
        • John Shotsky
          Thanks, Ian, The problem I m facing is that I may have 20 files open at one time, some with the same names but in different folders. I choose one to run my
          Message 4 of 9 , Oct 28, 2012
          • 0 Attachment
            Thanks, Ian,
            The problem I'm facing is that I may have 20 files open at one time, some with the same names but in different folders.
            I choose one to run my library against, and I want that file, the working file and the final version to be the rightmost
            three file tabs, so I know exactly which file was run and what the result is. That means moving the starting file tab to
            the rightmost position to start, then adding the other two as they are created. While that might sound fairly
            straightforward, there is actually more complexity involved, since the working file must be frozen at different times
            based on what is being processed. For example, if it is processing an xml file or an html file, and the final is to have
            no xml/html, then the work file needs to have the html removed, then frozen, then the final gets the rest of the
            formatting which is performed on plain text. Finally, a file comparison tool runs to see what that final result did to
            the frozen version. It would make no sense to compare an html file with a plain text file.

            Regards,
            John
            RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/

            From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Ian NTnerd
            Sent: Sunday, October 28, 2012 06:35
            To: ntb-clips@yahoogroups.com
            Subject: Re: [Clip] Re: Document tab organization


            John,

            Not knowing what you are doing, makes this a shot in the dark.

            For most of my processing I read a file into an array. Then if wanted,
            write it out to a file as each line is processed. It is more predictable
            than working on open files. But there is less RegEx options available
            doing it this way, it will be slower at times. With this method you know
            where everything should be put and just append it to the end of the file
            it belongs to.

            It may not suit.

            Ian

            On 28/10/2012 4:40 AM, John Shotsky wrote:
            > Thanks Flo, that at least tells me that I've been doing it correcty in the past. I actually create a file named
            'dummy'
            > that I open while I close the others, then I open them in the proper order, and destroy dummy. It works, but it feels
            > kludgy. I tried playing with screenupdate and StatusClose and walking through with debug on, and sometimes the closed
            > file tab simply stays in place. Fortunately, when the clip ends, everything is in the correct order, but it just feels
            > like something is not working right when I can't see a file close when told to close when stepping through manually.
            >
            > Regards,
            > John
            > RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/
            >
            > From: ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> [mailto:ntb-clips@yahoogroups.com
            <mailto:ntb-clips%40yahoogroups.com> ] On Behalf Of flo.gehrke
            > Sent: Saturday, October 27, 2012 11:49
            > To: ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com>
            > Subject: [Clip] Re: Document tab organization
            >
            >
            > --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> <mailto:ntb-clips%40yahoogroups.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
            >
            >
            >
            > [Non-text portions of this message have been removed]
            >
            >
            >
            > ------------------------------------
            >
            > Fookes Software: http://www.fookes.com/
            > NoteTab website: http://www.notetab.com/
            > NoteTab Discussion Lists: http://www.notetab.com/groups.php
            >
            > ***
            > Yahoo! Groups Links
            >
            >
            >
            >



            [Non-text portions of this message have been removed]
          • John Shotsky
            Oh, and I forgot to mention that when the file comparison is run, it is run as part of the clip library, so the system must know which files are the ones to be
            Message 5 of 9 , Oct 28, 2012
            • 0 Attachment
              Oh, and I forgot to mention that when the file comparison is run, it is run as part of the clip library, so the system
              must know which files are the ones to be compared. For anyone wanting a good text file comparison program, I use
              CompareIt!, which is granular enough to show each and every change, as well as providing line wrap on both sides, so you
              don't have to scroll off the screen to see ends of lines.

              It is on sale with a 25% discount until Nov 1.
              http://www.grigsoft.com/index.htm

              Regards,
              John
              RecipeTools Web Site: http://recipetools.gotdns.com/
              -----Original Message-----
              From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of John Shotsky
              Sent: Sunday, October 28, 2012 07:02
              To: ntb-clips@yahoogroups.com
              Subject: RE: [Clip] Re: Document tab organization

              Thanks, Ian,
              The problem I'm facing is that I may have 20 files open at one time, some with the same names but in different folders.
              I choose one to run my library against, and I want that file, the working file and the final version to be the rightmost
              three file tabs, so I know exactly which file was run and what the result is. That means moving the starting file tab to
              the rightmost position to start, then adding the other two as they are created. While that might sound fairly
              straightforward, there is actually more complexity involved, since the working file must be frozen at different times
              based on what is being processed. For example, if it is processing an xml file or an html file, and the final is to have
              no xml/html, then the work file needs to have the html removed, then frozen, then the final gets the rest of the
              formatting which is performed on plain text. Finally, a file comparison tool runs to see what that final result did to
              the frozen version. It would make no sense to compare an html file with a plain text file.

              Regards,
              John
              RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/

              From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Ian NTnerd
              Sent: Sunday, October 28, 2012 06:35
              To: ntb-clips@yahoogroups.com
              Subject: Re: [Clip] Re: Document tab organization


              John,

              Not knowing what you are doing, makes this a shot in the dark.

              For most of my processing I read a file into an array. Then if wanted,
              write it out to a file as each line is processed. It is more predictable
              than working on open files. But there is less RegEx options available
              doing it this way, it will be slower at times. With this method you know
              where everything should be put and just append it to the end of the file
              it belongs to.

              It may not suit.

              Ian

              On 28/10/2012 4:40 AM, John Shotsky wrote:
              > Thanks Flo, that at least tells me that I've been doing it correcty in the past. I actually create a file named
              'dummy'
              > that I open while I close the others, then I open them in the proper order, and destroy dummy. It works, but it feels
              > kludgy. I tried playing with screenupdate and StatusClose and walking through with debug on, and sometimes the closed
              > file tab simply stays in place. Fortunately, when the clip ends, everything is in the correct order, but it just feels
              > like something is not working right when I can't see a file close when told to close when stepping through manually.
              >
              > Regards,
              > John
              > RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/
              >
              > From: ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> [mailto:ntb-clips@yahoogroups.com
              <mailto:ntb-clips%40yahoogroups.com> ] On Behalf Of flo.gehrke
              > Sent: Saturday, October 27, 2012 11:49
              > To: ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com>
              > Subject: [Clip] Re: Document tab organization
              >
              >
              > --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> <mailto:ntb-clips%40yahoogroups.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
              >
              >
              >
              > [Non-text portions of this message have been removed]
              >
              >
              >
              > ------------------------------------
              >
              > Fookes Software: http://www.fookes.com/
              > NoteTab website: http://www.notetab.com/
              > NoteTab Discussion Lists: http://www.notetab.com/groups.php
              >
              > ***
              > Yahoo! Groups Links
              >
              >
              >
              >



              [Non-text portions of this message have been removed]



              ------------------------------------

              Fookes Software: http://www.fookes.com/
              NoteTab website: http://www.notetab.com/
              NoteTab Discussion Lists: http://www.notetab.com/groups.php

              ***
              Yahoo! Groups Links
            • Art Kocsis
              ... Not quite true - ^$GetDocCount$ will tell you how many tabs are open but, like Flo, I think the only way to control he order is to save, sort and reload
              Message 6 of 9 , Oct 28, 2012
              • 0 Attachment
                At 10/27/2012 05:58 AM, John wrote:
                >One doesn't know how many tabs are open or what order they are in.

                Not quite true - ^$GetDocCount$ will tell you how many tabs are open
                but, like Flo, I think the only way to control he order is to save, sort and
                reload the tab docs from a file.

                Art
              Your message has been successfully submitted and would be delivered to recipients shortly.