I'm trying to implement a feature by which the user can directly copy a piece of text into a specific file. (mini-clipboard type)

The first thing I researched about was of creating a universal context menu by which the user can select(/mark) the text he wants to copy to that file and then select a specific universal option (eg. Save to ..). But I then later realized that all applications have their own context menu so it is practically impossible to anything of that sort.

The next thing that came into my mind was of using custom shortcut to copy some text into a specific file,


Is there any way to get the current selected text, create a shortcut to that specific batch file and pass then selected text as a parameter to that batch-file?

We could use a text file as a temp storage for the current contents of the clipboard but the main question is how would I copy the content by just using one shortcut?

  • There are a number of third-party clipboard replacements that store copied text in a file. – DrMoishe Pippik Jan 31 at 21:00
  • I don't want to really replicate them, but I am I'm trying to achieve something else altogether. Could you name a few maybe I'll get some idea of as to how can I solve this problem by by myself? – Hello World Feb 1 at 3:31
  • Say you had to add another shortcut similar to Ctrl+C which would not only copy the currently marked contents but also execute a set of commands. How would you achieve it? – Hello World Feb 1 at 3:35
  • You intents is get a text in one file and add to another one, where the path to saved file will chose by dialogue box, or in a existent file with the context menu is used to open and past to selected one? Sorry my english, I’ve have one option to suggest. – It Wasn't Me Feb 13 at 0:17
  • @ItWasn'tMe The user will mark some text, press a key (SAY Ctrl+F9) and a window shall appear to him. So in my case, the user will select/mark text from literally any window and press the shortcut key. The selected text should become the contents of a file, so that the file name can be passed as the parameters to another file. Please post whatever is in your mind, maybe it could turn out to be the right answer.. – Hello World Feb 14 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.