topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 4:25 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Select text then drag to instant txt file  (Read 7867 times)

trw

  • Guest
IDEA: Select text then drag to instant txt file
« on: April 07, 2009, 10:12 AM »
Frequently I find myself having to create a blank text file using Notepad, navigate to a license email or web page, select the relevant text I want to save, copy it, paste it to the blank text file, and save it in the proper destination folder. I'd prefer to have the destination folder already open on the desktop, have the source window open nearby, and just select the text and drag it over to the folder, which would create a text file with the cursor active in the name so I can name it appropriately. Does anything exist like this?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Select text then drag to instant txt file
« Reply #1 on: April 07, 2009, 10:37 AM »
a compromise might be a hotkey which prompted for a filename/path dialog and then saved clipboard text there.
(in fact i think i'll add this to my clipboard help and spell program).

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: IDEA: Select text then drag to instant txt file
« Reply #2 on: April 07, 2009, 02:16 PM »
Hi, I have no drag drop solution but this hotkey alternative made in AHK is pretty quick:
1. select and copy text to save (ctrl+C)
2. select target folder (select folder icon on desktop or select an explorer window)
3. press hotkey (default: AppsKey a.k.a. "file properties menu opener key")

AppsKey::
if clipboard =
 return
ifwinactive, ahk_class Progman
{
ControlGet, x, List, Selected, SysListView321, A
x = %A_desktop%\%x%
}
else ifwinactive ahk_class CabinetWClass
 ControlGetText, x, Edit1, A
else
 return

Fileappend, %clipboard%, %x%\%A_Now%.txt
ToolTip,saved: %x%\%A_Now%.txt
sleep 2000
ToolTip
return

edit: though it does not offer a file rename step which you requested. But that shouldn't be hard to add. I'm off in a few secs so can't do it now -- maybe someone else'll pick it up from here.
« Last Edit: April 07, 2009, 02:21 PM by Nod5 »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA: Select text then drag to instant txt file
« Reply #3 on: April 07, 2009, 02:42 PM »
Another approach, if you install EditPad Lite I believe it adds an explorer option to the New menu for Text File.  When created the name before the extension is already highlighted for renaming.  Rename, hit Enter, now editor is open and just paste the text.  (There's probably a way to add Text File type to the New menu without being forced to use EditPad lite but I'm not sure what it is.)

« Last Edit: April 07, 2009, 02:44 PM by MilesAhead »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: IDEA: Select text then drag to instant txt file
« Reply #4 on: April 07, 2009, 10:26 PM »
i use a script from the AHK forums that i modified for my needs. with this script you can copy your text 1st then call this script which will open the text editor and paste the clipboard contents for you.

i wrote this small script that checks the clipboard for filename then:
a) opens the file in a text editor
b) if there is no valid filename, open the text editor then paste the contents
-website

; PasteClipboard.ahk
#NoTrayIcon

SetKeyDelay,0
;Change to your editor here...
edtPath=%ProgramFiles%\Metapad\metapad.exe
edtTitle=new file - metapad

;save clipboard contents
tmpString=%Clipboard%

If FileExist(tmpString) ;file or folder exists...
{
  FileGetAttrib, Attrib, %tmpString%
  IfInString, Attrib, D ; contains folder
  {
  Run, %edtPath%, %tmpString%
  }
  Else ; contains file
  {
  SplitPath, tmpString,CurFile,CurFolder,CurExt,,
  If CurExt in txt,ahk,bat,diz,inf,log,ini,m3u,nfo,reg,rtf,htm,html,css
    {
    Run, %edtPath% %tmpString%, %CurFolder%
    }
  Else
    {
    ;just paste clipboard...
    Run, %edtPath%, %A_MyDocuments%
    WinWaitActive, %edtTitle%
    Send,^v
    }
  }
}
Else
{
  ;restore clipboard...
  Clipboard=%tmpString%
  Run, %edtPath%, %A_MyDocuments%
  WinWaitActive, %edtTitle%
  Send,^v
}
Return
Exit   ; exits program

Source: http://www.autohotke...viewtopic.php?t=6962

mateek

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 78
    • View Profile
    • NewPray.com - A description of a broken window for world peace, law proposals, prophecy explanations, conspiracies, and more.
    • Donate to Member
Re: IDEA: Select text then drag to instant txt file
« Reply #5 on: June 30, 2009, 10:08 PM »
Better late than never?  I found this app called 'Send To Notepad' about a year ago I think.  Just sits in your tray, and if you click it's icon a new notepad window opens and your clipboard goes in.

The link is http://www.utkarshonline.com

It can be quircky, needing a 'rt-click copy' here, an Edit>Copy from the menu bar there, a Ctrl-C, every where a Ctrl-C...oh McDonald had a....oh sorry...

I use it enough to justify keeping it in startup.  Can't for the life of me remember where I found it, maybe a direct web search.  I lost something a paragraph long I'd typed in a form online, and I was looking for clipboard monitors.  I finally settled on Clipp found at www.geocities.com/urifrid which I just wrote the author of to see if he'll put it back on his website.  Otherwise, I have a copy of the executable somewhere if someone wants to tell me where to host it.  My websites don't seem to like off-subject things like downloads.

Hope it helps.
Stop war, change U.S. Politics, Kabbalah, my case modding, etc: My Website.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA: Select text then drag to instant txt file
« Reply #6 on: June 30, 2009, 10:20 PM »
Recently I wrote a small hotkey app for the purpose of snapping up pieces of source code from web forums.  But it can easily be used with text.  It's called SourceSnap and you can download from this page:

http://www.favessoft.com/hotkeys.html

When running in the tray, highlight some text, hit the hotkey.  A file save dialog pops up and you name the file.  Another hotkey edits the last saved file in the default editor for the file type.  Alternatively, there's an additional hotkey to save paragraphs to a "snap file."

Should work on Windows XP and later.

The hotkeys are adjustable from drop down dialogs and you can change the name of the snap file(a file for collecting fragments or paragraphs that don't rate saving to a distinct file.)