
Quiero agregar pequeños fragmentos de texto a archivos de texto.
Si alguien tiene un sistema para esto, no dude en publicarlo. Estoy intentando crearlo.
Enhttp://sourceforge.net/p/launchy/discussion/451015/thread/abba414bhubo una discusión sobre este usoLanzador(que ya usé - perfecto).
Agrega un script vbs a una carpeta que Launchy indexa y luego simplemente presiona
enpestaña"mis cosas en el archivo"ingresar
y el trabajo está hecho.
scripts viene aquí
en.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
Problema: Necesito las citas sobre mi entrada. Sería mejor si no lo hiciera.
Encontré este script después de:
- buscar en Google Agregar ventanas de texto
- lecturahttp://lifehacker.com/284127/take-launchy-beyond-application-launching
- lecturahttp://benkraal.wordpress.com/2007/05/16/launchy-append-text-to-a-file-from-anywhere/
- aterrizando en la discusión de Sourceforge vinculada arriba
Una ventaja adicional si puedo cambiar la ruta del archivo txt, digamos de \Dropbox\FolderA a \Dropbox\FolderB y el script aún estará intacto.
Respuesta1
Para evitar las comillas dobles alrededor de su entrada, es decir, presionar
at my things in the file
en lugar de
at "my things in the file"
usted, puede usar el siguiente fragmento de código en lugar de objFile.WriteLine objArgs(0)
:
strResult = ""
For ii = 0 to objArgs.Count - 1
strResult = strResult & CStr( objArgs( ii)) & Space( 1)
Next
objFile.WriteLine Rtrim( strResult)