I couldn´t find an example in the forum. The code should append the clipboard contents from a previous Clipboard Copy
into a text file, "sample.rtf", (or if rtf is problematic, txt will also do) in N:\RTFs\sample.
So starting with an empty file, the first run would insert the paths, & every new run would append more paths. The button
is intended to make an "inspection" list of various folders, which i can compare with my files at home, sort of "syncing".
I don't know how to append new text to an existing file, but what you can do is collecting everything you want to have in the Textfile in Clipboard.
I'm using leo's tool Setclip.exe for this:
[url]SetClip]
Here's the basic Code for collecting the full paths of all selected files in Clipboard which you can change to your needs (e.g. Select ALL in the second line):
@runmode hide
"[Path to Setclip.exe]\SetClip.exe" -a {filepath|noterm}
Before you start your Collection you should clear the Clipboard with this (put it to the RMB of a 3-way Button):
@nodeselect
@runmode hide
"[Path to Setclip.exe]\SetClip.exe" -e
Yeah, it works so far. I used setclip a while ago for collecting items, but switched to use the collections for that task.
Only problem is, it won´t work over several sessions, & i have to open the file manually (ok, i can add that line to the code
& save this step) & paste it in, or have to use multiple textfiles.
And download the free nircmd utility, you can do this with a couple Opus buttons set in MSDOS mode. Actually on my Windows 7 machine it doesn't seem to matter if the Opus buttons are in MSDOS mode or Standard Function (Opus or external).
Anyway, if you don't put nircmd in a folder that's defined in the Windows %PATH% environment variable, you'll have to include the full path to it in your buttons.
Button 1 creates a new text file named info.txt (overwriting any previous info.txt file) and copies the text in the clipboard to it.
Ooops, that´s why. I had confused the two commands in the 3-Button. Now it works.
Thank you both. Note: don´t try out button codes while watching a movie.