
我想將小段文字附加到 txt 檔案中。
如果有人有這方面的系統,請隨時發布。我正在嘗試創建它。
在http://sourceforge.net/p/launchy/discussion/451015/thread/abba414b對此進行了討論,使用拉奇(我已經使用過 - 完美)。
您將 vbs 腳本新增至 Launchy 索引的資料夾中,然後按一下
在標籤“我的東西在檔案裡”進入
工作就完成了。
腳本來到這裡
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
問題:我需要我的條目周圍的引用。如果我不這樣做會更好。
我發現這個腳本之後:
- 谷歌搜尋追加 txt 視窗
- 閱讀http://lifehacker.com/284127/take-launchy-beyond-application-launching
- 閱讀http://benkraal.wordpress.com/2007/05/16/launchy-append-text-to-a-file-from-anywhere/
- 登陸上面連結的 sourceforge 討論
如果我能夠將 txt 檔案的路徑從 \Dropbox\FolderA 更改為 \Dropbox\FolderB 並且腳本仍然完好無損,那就太好了。
答案1
要避免在您的條目周圍使用雙引號,即點擊
at my things in the file
而不是
at "my things in the file"
您可以使用下一個程式碼片段代替objFile.WriteLine objArgs(0)
:
strResult = ""
For ii = 0 to objArgs.Count - 1
strResult = strResult & CStr( objArgs( ii)) & Space( 1)
Next
objFile.WriteLine Rtrim( strResult)