Use dopus for code snippets?

Hi all,

i love the dopus feature which permits to paste clipboard content to create a new text file

To go further, and use dopus as some kind of code snippets application, i would like to be able to select a text file, and with the click of a button, copy the text inside (the code snippet) to the clipboard, that is without having to select the file, select all inside the preview, and copy

I don't think this is possible with dopus, however maybe some of you have a small app handy to achieve that ?

Thanks, cheers !

I could add this to my little SetClip program pretty easily. (At the moment the text has to be given on the command line but it would be easy to make it read a file instead.)

Next time I'm at home and not too tired I'll have a look at it.

Thanks Leo !

That would be great ! i'm sure it would be very interesting for many people !

By the way, many thanks for the great tutorial you made

Cheers

I also would find this to be a useful tool. :bulb:
regards,
:opussanta: porcupine

I've updated SetClip so it can read a file and put it into the clipboard:

pretentiousname.com/miscsoft ... ml#SetClip

I also added an option to put the arguments into the clipboard as a single line, rather than one line per argument.

Going back to the original post in this thread, you could speed things up even more by giving the source-clip files a special extension and then creating an Opus filetype which runs SetClip.exe when you double-click them. Of course, a hotkey or toolbar button is also an option.

Many many thanks for this great update !

I am sure it will be of help for many users...

Good idea to speed things a little, but when you paste text from the clipboard, it creates a .txt files

So i think, i will keep the .txt extension and use the double middle click to run setclip...

Thanks again.

By the way, there's an option in the TextThumbs plugin which will put the (first 255 bytes of the) contents of text files into the Description column. This might be useful as part of your code-snippets (unless all the code starts with the same sort of thing).

Leo, it's absolutely FANTASTIC !

At minimum it's an easy method to access a source code file that contains code of a specific function or functions.

Expanding on this,
at least a few such function sourcecode files can be selected and their contents copied to the clipboard all in one shot.
I'm not exactly certain what the limit is here ( be careful you can freeze your computer doing this ).
I tend to think it's a DOS character limit,
but I do note that I've run some ridiculously long command line arguments from within a C++ program using System().

Even more, SetClip, used with good judgement ,
can now be an alternative to using text files or DOS pipes to transfer data from one program to the next.
I'm thinking only of simple command line program modules in a button all preceeded with sync: .
Ultimately a database, a text file , or a comprehensive program is the better answer, but SetClip can now be a starting module to such ideas.

Well, to come out of the clouds, that is if I can figure out how to reverse the process and access the clipboard line by line as I can in 4NT,
it just might be an interesting alternative.

Thanks for the program Nudel !

:opussanta: porcupine