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

Re:[Clip] Using Help (was: [NTS] Changing CR & LF)

Expand Messages
  • Alec Burgess
    btw Art - I just noticed that this thread is in the ntb-scripts group. Its perfectly appropriate for this group but readership (and help available from others)
    Message 1 of 1 , Jun 12, 2008
    View Source
    • 0 Attachment
      btw Art - I just noticed that this thread is in the ntb-scripts group. Its
      perfectly appropriate for this group but readership (and help available from
      others) is much wider in ntb-clips so I've copied it to that group.

      Ntb-scripts - Members: 182, Ntb-clips - Members: 1626 (and for reference)
      Notetab Members: 2480

      On Fri, Jun 13, 2008 at 12:37 AM, Art Kocsis <artkns@...> wrote:
      First your comment to John:

      > >^!Replace "\R+" >> "^%NL%" ARSTW
      > >
      > >Will change your paragraph spacing, because any paragraph separation lines
      >
      > >will disappear.
      > >If you want to retain a blank line between paragraphs, it should be:
      > >
      > >^!Replace "\R" >> "^%NL%" ARSTW


      I think you are kind-of both correct (though as you indicate if what you
      want to create a file/document that is record oriented (eg. CSV file) what
      you have done is correct for your purposes. However another frequent need
      (and this is what I think John was getting at) is to have paragraph oriented
      text but wanting to suppress multiple empty line feeds between them. btw:
      when working with regular expressions, in the Replace field I've always used
      "\r\n" to represent one line-feed (actually a <RET><LF> pair which is
      correct for Windows files though not always for *nix and Mac. I trried using
      %NL% in the [Replace with:] field of a Replace dialog with Regular
      Expressions turned on. It appears to be inserted literally (eg
      "previousline%NL%nextline")

      Any how ....

      Thus two possibilities

      ; no blank lines (record oriented) - what Art wants:
      ; two or more line feeds are reduced to one
      ^!replace "\R{2,}" >> "\r\n" rwsai
      ; preserve paragraph spacing (what John was suggesting)
      ; three or more line feeds are reduce to two
      ^!replace "\R{3,} >> "\r\n\r\n" rwsai

      Turning to your other questions/comments:

      Getting back to the Clip Help file it is huge and I find I spend a huge
      > amount of time searching it ...


      Step 1 - get familiar with the Contents page. It sets out the general
      "themes" of what is contained in the whole document.

      Step 2 - use the Index. Sheri spent a LOT of time organizing the the index
      so that if you type in the intro to any command you will get a list of all
      commands/functions that start with the entered characters.

      so enter ^! and you get a list of ALL commands. Remember that two major
      "groups" of commands are "If" commands and "Set" commands. Thus entering
      either "^!If" or "^!Set" will quickly get you to approximately the right
      place.

      Now we come to functions: Notice a lot of functions start with one of:
      ^$Get, ^$Is and ^$Str
      The ^$Get group retrieve some info about the system or the state of the
      Notetab program
      The ^$Is group are useful for testing things (most frequently in conjunction
      with an ^!IF command)
      The ^$Str group typically take a string argument and return the string
      transformed in some way.

      Note that you find something using either the Index or the Search tab in
      Help and then flip to the Contents tab you will see the entry you've just
      located within its context there. Helps to grok the gestalt of Notetab :-)


      > even for stuff I have seen before


      when you find something that makes you say "Ah ha, I'm probably going to
      want to this again! save the page in the Favorites tab. You can change the
      name under which the entry is saved. For example, I've got the Find/Replace
      page in Favorites as: "Find / Replace Text (see bottom for regex functions)"
      because I can never remember what all those functions are named / never mind
      the exact syntax ;-(

      One other technique I use for those with a complicated syntax (eg the sort
      function) when I use it is to put its definition ((commented out) copied
      from the clip help, above its use in my clip.

      ;^$StrSort("Str";CaseSensitive;Ascending;RemoveDuplicates)$
      ^!set %sortedClipboard%=^$StrSort("^$GetClipboard$";False;True;True)$

      makes it a LOT easier if two months later you want to change/tweak the way
      the clip works.

      let alone
      > commands or techniques of which I am not aware. There are not
      > enough internal links and the organization is frequently not the way
      > that I think. To find all these tidbits I would need to read the file end
      > to end a few times which would take forever.


      I feel your pain. Notetab was probably the first program I ever downloaded
      (Thank you Ed Bott in the now defunct About Windows forum). That was around
      early 2001. I still wind up going to Clip Help almost every time I try to
      code anything other than a simple one-line replace clip.


      > In the meantime, I am
      > collecting the various command names that I use or that look promising
      > into a single sorted file. Maybe that will help.


      See comment above about putting the note-worthy ones in your Favorites list
      in the Help File!


      > Thankfully there is this list
      > that reap the benefit of other eyes reading the help file, like
      >
      > "trying to drive an external window from within Notetab" ?? Was ist??
      >

      See topic in Contents "Executing Programs" especially command:

      > ^!FocusApp AppTitle (added in v4.52)
      >
      > Activates the application window with a title caption that matches the
      > specified text. The error flag is set if no matching window is found. For
      > example, if the Windows calculator utility is open, the following command
      > will bring it to the front:
      >
      > ^!FocusApp Calculator


      Once an app is focused, subsequent ^!Keyboard commands will act in the
      context of the focused app rather than notetab. For an example of use look
      in Library "Sample code" and examine the clip "Use Windows Calculator"

      For examples and template code for this and other topics look at
      http://www.notetab.com/libraries.php - overall site design and many
      libraries contributed by Jody Adair.
      (R.I.P Jody - I hope you are ready - hurricane season is about to start
      again)

      --
      Regards ... Alec
      --


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.