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

Clip bar library versus the current library

Expand Messages
  • Eb Guenther
    Hi all, ^$GetLibraryName$ returns the library a clip is located in, but I need a way to return the library name currently displayed in the clipbook. I want
    Message 1 of 10 , Aug 31, 2000
      Hi all,

      "^$GetLibraryName$" returns the library a clip is located
      in, but I need a way to return the library name currently
      displayed in the clipbook.

      I want to run a clip from the Clipbar, and return the active
      library in Clipbook window, and need this to work for any
      library.

      Setting a %p_ variable from each lib is not practical, as
      I want to process libraries that someone else created.

      Any ideas?


      Cheers,


      Eb.
    • Jody
      Hi Eb and Eric, ... Eric s Clipbar caught him in telling us a little fib. ;) ^$GetLibraryName$ Returns the name of the current Clipbook library. It does what
      Message 2 of 10 , Aug 31, 2000
        Hi Eb and Eric,

        >"^$GetLibraryName$" returns the library a clip is located
        >in, but I need a way to return the library name currently
        >displayed in the clipbook.
        >
        >I want to run a clip from the Clipbar, and return the active
        >library in Clipbook window, and need this to work for any
        >library.

        Eric's Clipbar caught him in telling us a little fib. ;)

        ^$GetLibraryName$
        Returns the name of the current Clipbook library.

        It does what Eb says it does.

        Eric, I don't remember if I told you this or just had good
        intentions, but Ctrl+C does not work in the Rename popup from the
        Clipbook combobox. See below, the ;commented line no workie due
        to no Ctrl+C.

        It be a wee bit sloppy, but it works:

        ^!SetFocus Clipbook
        ; ^!Keyboard Shift+Tab Shift+F10 &10 R &50 Ctrl+C ESC
        ; You may be able to take out the delay
        ^!Keyboard Shift+Tab Shift+F10 &10 R &50 Shift+F10 C ESC
        ^!Set %LibName%=^$GetClipboard$
        ^!Info ^%LibName%

        ----

        ^!Info ^$GetValue(Clipbook:DefaultLibrary)$ doesn't work because
        the setting doesn't get changed until shutdown. There might be
        another way, but I do not know the trick.

        Happy Clip'n!
        Jody

        http://www.sureword.com/notetab

        Subscribe, UnSubscribe, Options
        mailto:Ntb-Clips-Subscribe@...
        mailto:Ntb-Clips-UnSubscribe@...
        http://www.egroups.com/group/ntb-clips
      • Larry Thomas
        Hi Eb, Jody, Eric and All, ... Here is the trick. Place the clip below in any library and then place a button to it on the clipbar and click on it with
        Message 3 of 10 , Aug 31, 2000
          Hi Eb, Jody, Eric and All,

          At 04:20 PM 08/31/2000 -0500, Jody wrote:
          >Hi Eb and Eric,
          >
          >>"^$GetLibraryName$" returns the library a clip is located
          >>in, but I need a way to return the library name currently
          >>displayed in the clipbook.
          >>
          >>I want to run a clip from the Clipbar, and return the active
          >>library in Clipbook window, and need this to work for any
          >>library.
          >
          >Eric's Clipbar caught him in telling us a little fib. ;)
          >
          >^$GetLibraryName$
          >Returns the name of the current Clipbook library.
          >
          >It does what Eb says it does.
          >
          >Eric, I don't remember if I told you this or just had good
          >intentions, but Ctrl+C does not work in the Rename popup from the
          >Clipbook combobox. See below, the ;commented line no workie due
          >to no Ctrl+C.
          >
          >It be a wee bit sloppy, but it works:
          >
          >^!SetFocus Clipbook
          >; ^!Keyboard Shift+Tab Shift+F10 &10 R &50 Ctrl+C ESC
          >; You may be able to take out the delay
          >^!Keyboard Shift+Tab Shift+F10 &10 R &50 Shift+F10 C ESC
          >^!Set %LibName%=^$GetClipboard$
          >^!Info ^%LibName%
          >
          >----
          >
          >^!Info ^$GetValue(Clipbook:DefaultLibrary)$ doesn't work because
          >the setting doesn't get changed until shutdown. There might be
          >another way, but I do not know the trick.

          Here is the trick. Place the clip below in any library and then place a
          button to it on the clipbar and click on it with different libraries open.

          ---------< start clip >---------
          H="GetLibrary Name"
          ;Larry Thomas <larryt@...>
          ;08/31/2000, 05:20:58 PM
          ^!ProgIniSave
          ^!Info ^$GetValue(Clipbook:DefaultLibrary)$
          ^!ProgIniLoad
          ---------< end clip >-----------

          Regards,

          Larry
          larryt@...
        • Eb Guenther
          Hi Larry, ... Thanks for your suggestion. It works, but has some side effects with special INI files. If I don t give the command an INI file name it seems to
          Message 4 of 10 , Sep 1, 2000
            Hi Larry,

            > >>I want to run a clip from the Clipbar, and return the active
            > >>library in Clipbook window, and need this to work for any
            > >>library.
            ><...>
            > >^!Info ^$GetValue(Clipbook:DefaultLibrary)$ doesn't work because
            > >the setting doesn't get changed until shutdown. There might be
            > >another way, but I do not know the trick.
            >
            >Here is the trick. Place the clip below in any library and then place a
            >button to it on the clipbar and click on it with different libraries open.
            >
            >---------< start clip >---------
            >H="GetLibrary Name"
            >;Larry Thomas <larryt@...>
            >;08/31/2000, 05:20:58 PM
            >^!ProgIniSave
            >^!Info ^$GetValue(Clipbook:DefaultLibrary)$
            >^!ProgIniLoad
            >---------< end clip >-----------

            Thanks for your suggestion. It works, but has some side effects with
            special INI files.


            If I don't give the command an INI file name it seems to save to the
            start-up INI file, and without ^!ProgIniLoad the current INI file does not
            have the DefaultLibrary variable, and _with_ ^!ProgIniLoad it changes to
            the INI file it's loading.

            On the other hand, if I _do_ give it my INI file name (^$GetIniFile$), then
            ^!ProgIniSave changes my small 1 KB INI file, containing only the data I
            want it to hold, to a hard to handle 10 KB file, containing the whole
            NoteTab configuration.

            Am I making sense?

            So, I seem to be stuck with Jody's Keyboard magic ;) which also works.
            But thanks for the suggestion, Larry. I will keep it in mind for other uses.


            Regards,

            Eb
          • Eb Guenther
            Hi Jody, ... Thanks for your suggestion. It works, and I will try it for a while. Though the ^!Keyboard command always has me concerned about keyboard
            Message 5 of 10 , Sep 1, 2000
              Hi Jody,

              > >I want to run a clip from the Clipbar, and return the active
              > >library in Clipbook window, and need this to work for any
              > >library.

              Thanks for your suggestion. It works, and I will try it for a while.
              Though the ^!Keyboard command always has me concerned about keyboard
              conflicts :-(.


              Also see my post to Larry. There would seem to be a need for a better way
              to retrieve the current library name.

              One half-vast solution would be to add an "INI file" option for the
              ^$GetValue function. I.e. ^$GetValue([[file:]section:]key)$

              Better would be to provide a separate function to identify the default
              library in the clipbook, as opposed to one that returns the library a clip
              is located in. I.e. ^$GetClipbookLib$.



              Regards,

              Eb
            • Larry Thomas
              Hi Eb, ... You are not stuck with the keyboard command or at least I don t think so. The keyboard command sequence could actually be simpler than what I am
              Message 6 of 10 , Sep 1, 2000
                Hi Eb,

                At 01:07 PM 09/01/2000 -0400, you wrote:
                >Hi Larry,
                >
                >>Here is the trick. Place the clip below in any library and then place a
                >>button to it on the clipbar and click on it with different libraries open.
                >>
                >>---------< start clip >---------
                >>H="GetLibrary Name"
                >>;Larry Thomas <larryt@...>
                >>;08/31/2000, 05:20:58 PM
                >>^!ProgIniSave
                >>^!Info ^$GetValue(Clipbook:DefaultLibrary)$
                >>^!ProgIniLoad
                >>---------< end clip >-----------
                >
                >Thanks for your suggestion. It works, but has some side effects with
                >special INI files.
                >
                >
                >If I don't give the command an INI file name it seems to save to the
                >start-up INI file, and without ^!ProgIniLoad the current INI file does not
                >have the DefaultLibrary variable, and _with_ ^!ProgIniLoad it changes to
                >the INI file it's loading.
                >
                >On the other hand, if I _do_ give it my INI file name (^$GetIniFile$), then
                >^!ProgIniSave changes my small 1 KB INI file, containing only the data I
                >want it to hold, to a hard to handle 10 KB file, containing the whole
                >NoteTab configuration.
                >
                >Am I making sense?

                You are not stuck with the keyboard command or at least I don't think so.
                The keyboard command sequence could actually be simpler than what I am
                suggesting but here goes.

                ^!SetIniFile
                ;without a file name this sets the default to Notepro.ini
                ^!ProgIniSave
                ^!Set %LibraryName%=$GetValue(Clipbook:DefaultLibrary)$
                ^!SetIniFile Small.ini
                ;switches the ini to the small one you want
                ^!SaveValue Clipbook:DefaultLibrary=^%LibraryName%
                ^!ProgIniLoad

                !SetIniFile changes all ini save and load commands to the ini files
                specified after it without further identification required by you. This
                will remain in effect through the clip execution until and unless you
                change it with another !SetIniFile command. The last two lines should save
                to and load information from your small ini file. ^!ProgIniSave is a
                general save of most if not all of NoteTab's settings to the currently
                defined ini file and you should not use it there for your purposes. You
                need to use ^!SaveValue instead which limits the saved information to that
                which you want saved and not all of or most of NoteTab's current settings.

                HTH

                Regards,

                Larry
                larryt@...
              • Jody
                Hi Eb ... It normally works pretty good, just kind of flashy. ;) The View menu is a bit trickier. Delays are needed because of the Clipbar menu. Eric is
                Message 7 of 10 , Sep 1, 2000
                  Hi Eb

                  >Thanks for your suggestion. It works, and I will try it for a
                  >while. Though the ^!Keyboard command always has me concerned
                  >about keyboard conflicts :-(.

                  It normally works pretty good, just kind of flashy. ;) The View
                  menu is a bit trickier. Delays are needed because of the Clipbar
                  menu. Eric is real good about not changing the shortcuts also.

                  >Also see my post to Larry.

                  I did and after reading it and getting confused, I closed it for
                  later, or is that Larry. ;)

                  >One half-vast solution would be to add an "INI file" option for the
                  >^$GetValue function. I.e. ^$GetValue([[file:]section:]key)$

                  ^!SetIniFile FileName
                  ^$GetValue(section:key)$

                  It gets tricky when other ini files are involved. You need to
                  get the current ini and save it in a variable then restore it
                  after you do what you have to do. I've run into it a number of
                  times with Clipbar Clips.

                  >Better would be to provide a separate function to identify the
                  >default library in the clipbook, as opposed to one that returns
                  >the library a clip is located in. I.e. ^$GetClipbookLib$.

                  Yes, or just make ^$GetLibraryName$ do that. If you are the one
                  running the Clip you ought to know what Library it is in already.

                  Happy Clip'n!
                  Jody

                  http://www.sureword.com/notetab

                  Subscribe, UnSubscribe, Options
                  mailto:Ntb-Clips-Subscribe@...
                  mailto:Ntb-Clips-UnSubscribe@...
                  http://www.egroups.com/group/ntb-clips
                • Eb Guenther
                  Hi Jody, ... But that was precisely the problem -- I didn t know which library was going to be default when the clipbar clip was being run. I needed to get the
                  Message 8 of 10 , Sep 1, 2000
                    Hi Jody,

                    > >Better would be to provide a separate function to identify the
                    > >default library in the clipbook, as opposed to one that returns
                    > >the library a clip is located in. I.e. ^$GetClipbookLib$.
                    >
                    >Yes, or just make ^$GetLibraryName$ do that. If you are the one
                    >running the Clip you ought to know what Library it is in already.

                    But that was precisely the problem -- I didn't know which library was going
                    to be default when the clipbar clip was being run. I needed to get the
                    default library name, not clipbar.clb.

                    Cheers,


                    Eb
                  • Jody
                    Hi Eb, ... I meant, you know which Library the Clipbar Clip is in or any Clip that you are running, so ^$GetLibraryName$ does not need to return the Library
                    Message 9 of 10 , Sep 2, 2000
                      Hi Eb,

                      >> Yes, or just make ^$GetLibraryName$ do that. If you are the
                      >> one running the Clip you ought to know what Library it is in
                      >> already.
                      >
                      >But that was precisely the problem -- I didn't know which library
                      >was going to be default when the clipbar clip was being run. I
                      >needed to get the default library name, not clipbar.clb.

                      I meant, you know which Library the Clipbar Clip is in or any
                      Clip that you are running, so ^$GetLibraryName$ does not need to
                      return the Library name of that Clip. Instead, it could return
                      the name of the Library that is loaded in the Clipbook. If you
                      use the ^!Clip or ^!FarClip command, you still know what clip is
                      being run.

                      I cannot think of any case where you would not know unless you
                      purposely made some type of random picker to run a Clip from a
                      list of Clip names. I use the time though to get a primitive
                      random generator though in my SureWord Library activate a popup.
                      I made it way back in v4.0 so I am sure by know I could use a
                      better method, but why fix something that works, eh? :)

                      Happy Clip'n!
                      Jody

                      http://www.sureword.com/notetab

                      Subscribe, UnSubscribe, Options
                      mailto:Ntb-Clips-Subscribe@...
                      mailto:Ntb-Clips-UnSubscribe@...
                      http://www.egroups.com/group/ntb-clips
                    • Larry Thomas
                      Hi Eb and Jody, ... This is a bit tedious but if you have the will here is another way to be sure you have the default library name retrieved by a clipbar
                      Message 10 of 10 , Sep 2, 2000
                        Hi Eb and Jody,

                        At 05:54 PM 09/01/2000 -0400, you wrote:
                        >Hi Jody,
                        >
                        >>Yes, or just make ^$GetLibraryName$ do that. If you are the one
                        >>running the Clip you ought to know what Library it is in already.
                        >
                        >But that was precisely the problem -- I didn't know which library was going
                        >to be default when the clipbar clip was being run. I needed to get the
                        >default library name, not clipbar.clb.

                        This is a bit tedious but if you have the will here is another way to be
                        sure you have the default library name retrieved by a clipbar clip. Add
                        the following clip to all of your clip libraries (yes, I said all - very
                        tedious isn't it?).

                        H="OnOpen"
                        ^!TextToFile "LibName.txt" ^$GetLibraryName$

                        Then place the following clipcode into the clip located on the clipbar that
                        you want to retrieve the current default library.

                        H="LibraryName"
                        ^!Info ^$GetFileText(LibName.txt)$

                        If you already have an Onopen clip in a library just add the above code in
                        "OnOpen" as the first line of that clip. Everytime you change libraries,
                        the new library that you open will replace the name in LibName.txt with its
                        own so when you run the "LibraryName" clip you will get the current default
                        name whether that library is open or not.

                        Regards,

                        Larry
                        larryt@...
                      Your message has been successfully submitted and would be delivered to recipients shortly.