1
I want to append small snippets of text to txt files.
If someone has a system for this, feel free to post it. I'm trying to create it.
At http://sourceforge.net/p/launchy/discussion/451015/thread/abba414b there was a discussion on this using Launchy (which I already did use - perfect).
You add a vbs script to a folder that Launchy indexes and then just hit
at tab "my things in the file" enter
and the job is done.
scritps comes here
at.vbs
Const ForAppending = 8
Dim strTextFile
Set objArgs = WScript.Arguments
strTextFile = "C:\home\todo.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strTextFile) Then
Set objFile = objFSO.OpenTextFile(strTextFile, ForAppending)
Else
Set objFile = objFSO.CreateTextFile(strTextFile)
End If
objFile.WriteLine objArgs(0)
objFile.Close
Problem: I need the qoutes around my entry. Would be better if I did not.
I found this script after:
- googling Append txt windows
- reading http://lifehacker.com/284127/take-launchy-beyond-application-launching
- reading http://benkraal.wordpress.com/2007/05/16/launchy-append-text-to-a-file-from-anywhere/
- landing on the sourceforge discussion linked above
Bonus if I'm able to change the path of the txt file say from \Dropbox\FolderA to \Dropbox\FolderB and the script still be intact.
haven't used launchy much as it seemed to miss out indexing things I needed when I tried it. But you should know
echo linetoappend >>c:\blah\file.txt
is a command you can run from cmd(start...run..cmd<ENTER>)that appends a line to a file. – barlop – 2014-07-10T22:57:23.520You might want the vbs file to take 2 parameters one being the filename, the other being the line to append. The person at that link wanted just one parameter, and so multiple scripts so called with different names, each taking one parameter. He also wrote one with two parameters. – barlop – 2014-07-10T23:09:26.647
This link has the path
strTextFile = "C:\home\todo.txt"
it's not clear what you want to change there. Just change it – barlop – 2014-07-10T23:13:25.480