Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to use AHK to create the following program:

  1. I highlight some text, and hit ctrl+c.
  2. I hit the keyboard shortcut, say #c
  3. Notepad++ creates a new text file with the content, and promts me to fill in the file name.
  4. the txt file is saved in the same location every time, namely /Dropbox/PlainText/Simpletext/

Bonus if I could browse and choose folder in the 4th option.

Is this possible to script?

I do know about click.to

share|improve this question

1 Answer 1

This will create the file, overwriting any existing file you've highlighted, and then open it with Notepad. Replace notepad.exe with the path to the Notepad++ exe:

#c::
FileSelectFile, FileToSaveTo, S, \Dropbox\PlainText\Simpletext\
Msgbox, %FileToSaveTo%
IfExist, %FileToSaveTo%
  FileDelete, %FileToSaveTo%
FileAppend, %Clipboard%, %FileToSaveTo%
Run, notepad.exe, %FileToSaveTo%
return
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.