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

20582Re: [Clip] Re: Clipboard boilerplate for cn_le

Expand Messages
  • loro
    Apr 19, 2010
      diodeom wrote:
      >I see by now that for me to call your concept "handy" was a terrible
      >understatement. I'm at the point of asking myself: why would I still
      >want to employ another app for the majority of my manual text
      >capturing tasks, when in your brilliantly simple "organizing
      >clip/pasteboard" copied snippets become conveniently identifiable,
      >paste-able, free of any formatting gunk and, most importantly,
      >directly scriptable -- all right in my favorite text processor?

      "Brilliant" is a slight overstatement, but thank you kindly, sir! :-)
      Since you like it you may want a clip I removed when I posted it
      before. It pasts all collected snips in a new document. I find it
      easier to remove unwanted snip-clips and then paste it all than the
      other way around.

      Thanks for the info about what library path functions that work.
      ^$GetLibraryPath(^$GetLibraryName$)$ may be the best one since tha
      also works in 4.95. I've installed a Light w/o ini now. Probably good
      to test before sharing.

      Here goes. 3 longish lines.
      h="Paste All"

      ^!Set %ww%=^$IsWordWrap$
      ^!Set %snips%=^%empty%
      ^!SetWordWrap off
      ^!SetScreenUpdate off

      ; Long line
      ^!Open "^$GetLibraryPath(^$GetLibraryName$)$^$GetLibraryName$.clb"
      ; End long line
      ^!Jump text_start
      ^!Find "^%sc%Text collected from clipboard""

      ^!Jump select_end
      ^!Find "h="" SI
      ^!IfError do
      ^!Jump select_end
      ^!Set %start_pos%=^$GetRow$:^$GetCol$
      ^!Find """
      ^!Jump select_start
      ^!SelectTo ^%start_pos%
      ^!Set %this%=^$GetSelection$¤
      ^!Append %snips%=^%this%
      ^!Goto loop

      ^!Set %cntr%=0
      ^!SetListDelimiter ¤
      ; Long line
      ^!SetArray %snips%=^$StrDelete("^%snips%";^$StrSize("^%snips%")$;1)$
      ; End long line
      ^!Menu File/new
      ^!Inc %cntr%
      ^!Clip "^%snips^%cntr%%"
      ; Long line
      ^!InsertText --------------------------------------^p
      ; End long line
      ^!If ^%cntr%=^%snips0% fini
      ^!Goto paste-loop

      ^!If ^%ww%=1 next else end
      ^!SetWordWrap on

    • Show all 24 messages in this topic