DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Drag any text or right click and save as a file  (Read 7,776 times)

nampara17

  • Participant
  • Joined in 2008
  • *
  • Posts: 1
Drag any text or right click and save as a file
« on: May 18, 2012, 08:01 AM »
Hi All,

I'm looking for a simple application (lightweight) that will allow me to:

  • Select ANY text (browser, txt file, etc.)
  • Right Click and then save the text to a file
  • IF the content is HTML formatted give me the option to save as formatted HTML or pure TXT[

I realise there should be 100's of these apps out there but cannot find anything.

My editors will allow me to copy text into the editor and then obviously save, but this is more for clips or sections of content that I just want to save in either formatted text or plain text. I don't need clipboard controllers and utils, just plain right click, save as... functionality.

Any help much appreciated

Jonathan

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: Drag any text or right click and save as a file
« Reply #1 on: May 18, 2012, 04:02 PM »
Welcome to the site, nampara17.  :D

I realise there should be 100's of these apps out there but cannot find anything.

Unfortunately, your requirements are what make this not trivial at all and is the reason why there are no apps out there that try to do this.  Let me explain.  First of all, right-clicking in an application is handled directly by said application.  Without some sort of API or plugin system for a given app, you simply can't hook into all the right-click menus of each and every app.  The problem is that the vast majority of apps do not offer APIs or plugin mechanisms and, even if they did, you'd have to write a separate handler for each application you want to support.  This is one of those coding problems that seems easy enough to humans but is terribly difficult to code for.  Follow me?

I don't need clipboard controllers and utils, just plain right click, save as... functionality.

It's ironic, but you're almost certainly going to have to use the clipboard for such functionality since it's the only common facility between different applications (when attempting to copy text).  You could still accomplish much of what you want by using, say, Ctrl+RightClick to popup a custom menu with a "Save as..." entry.  The app would then copy the selected text to clipboard and save it out as a your specified filename.  Something like this would actually be trivial to write with a bit of AutoHotkey script.  Are you open to this type of workflow?

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 48
Re: Drag any text or right click and save as a file
« Reply #2 on: May 21, 2012, 10:18 AM »
Hi Jonathan,

I could do that pretty easily with plain text using a keyboard shortcut such as CTRL+SHIFT+c to copy the selected text. Do you want the title of the window it was copied from and the date? 
« Last Edit: July 04, 2012, 04:30 PM by shmuel1 »

joiwind

  • carpe momentum
  • Participant
  • Joined in 2009
  • *
  • Posts: 486
Re: Drag any text or right click and save as a file
« Reply #3 on: May 21, 2012, 11:05 AM »
Jonathan : have a look at this, you may be able to tweak it to do what you want... or check its big brother.
« Last Edit: May 21, 2012, 11:19 AM by joiwind »

shmuel1

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 48
Re: Drag any text or right click and save as a file
« Reply #4 on: July 04, 2012, 05:19 PM »
Hi Jonathan,

Here's a very small program for copying text to a file. When you run the program, select any text, then press Ctrl+WindowsKey+c to copy the text to a file. It saves the text to a file called Clips.txt on your desktop. If the file does not exist, the program creates it.

Let me know if you want any changes. I also included the source code. It's a tiny program. If you install AutoIt (free) you can edit the code yourself. The code is very easy to read.

Shmuel

Original address: https://www.donationcoder.com/forum/index.php?topic=31055.0