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

Re: [Clip] Using scripts in clips?

Expand Messages
  • Larry Hamilton
    Yes. This is a common use. There are some examples of AWK scripts that come with NoteTab. Others have used perl, Java, and others. ~Larry ... [Non-text
    Message 1 of 4 , Oct 16, 2011
    • 0 Attachment
      Yes. This is a common use.

      There are some examples of AWK scripts that come with NoteTab.

      Others have used perl, Java, and others.

      ~Larry

      On Sun, Oct 16, 2011 at 5:10 PM, Robert Bull <barlennan@...> wrote:

      > I have a few clips, and the odd AWK script which works on all the
      > (marked?) text in a file. They seem to be two separate ideas.
      >
      > Is it possible to use scripts *inside clips*? What I wondered was
      > whether one could use NTP's native clip functions to, say, retrieve
      > the contents of the clipboard, feed that text through an AWK script,
      > and have NTP pick up the result and insert it into the current file.
      >
      >
      > --
      > TIA,
      >
      > Robert Bull
      > mailto:barlennan@...
      >


      [Non-text portions of this message have been removed]
    • diodeom
      ... I d consider ^$GetOutput()$ to pass args/variables and get back the results. (For really large blocks of text to process you could just submit the path of
      Message 2 of 4 , Oct 16, 2011
      • 0 Attachment
        Robert Bull <barlennan@...> wrote:
        >
        > I have a few clips, and the odd AWK script which works on all the
        > (marked?) text in a file. They seem to be two separate ideas.
        >
        > Is it possible to use scripts *inside clips*? What I wondered was
        > whether one could use NTP's native clip functions to, say, retrieve
        > the contents of the clipboard, feed that text through an AWK script,
        > and have NTP pick up the result and insert it into the current file.
        >

        I'd consider ^$GetOutput()$ to pass args/variables and get back the results. (For really large blocks of text to process you could just submit the path of the file to open by your AWK script.)

        Here's a purposely overdrawn illustration of one of the ways I utilize for communication between Clip and Lua:

        ;[path to exe]
        ^!Set %lua%=
        ;[path to the script]
        ^!Set %script%=
        ;[text to process, e.g. ^$GetSelection$, ^$GetClipboard$]
        ^!Set %input%=

        ^!InsertText ^$GetOutput(^%lua% "^%script%" "^%input")$
      Your message has been successfully submitted and would be delivered to recipients shortly.