How to append text copied to clipboard to a file.txt
Posted: 08 Jan 2013 20:13
Suppose I have a file structure on a CD/DVD like this:
[VIDEO FOLDER 1]
---[VFolder1]
---VideoFile1.avi
---VideoFile1.srt
---VideoFile1-ENG.srt
[VIDEO FOLDER 2]
---[VFolder2]
---VideoFile2.avi
---VideoFile2.srt
---VideoFile2-ENG.srt
[VIDEO FOLDER 3]
---[VFolder3]
---VideoFile3.avi
---VideoFile3.srt
---VideoFile3-ENG.srt
So when I open my CD/DVD I see this
[VIDEO FOLDER 1]
[VIDEO FOLDER 2]
[VIDEO FOLDER 3]
I'd like to write such a script that does the followings:
1. Open [VIDEO FOLDER 1]
2. Select all the files and folders inside it.
3. Copy the names of them with the file sizes in KB (bytes) into a .txt file.
That is I'd like to get a video.txt file with the following contents:
[VIDEO FOLDER 1]
---[VFolder1]
---VideoFile1.avi --> Size: 338 854 KB (346 986 494 bytes)
---VideoFile1.srt --> Size: 1 KB (347 bytes)
---VideoFile1-ENG.srt --> Size: 1 KB (347 bytes)
Then
4. Go to the next folder [VIDEO FOLDER 2]
Get the same information like at [VIDEO FOLDER 1]
5. Append this new text information to the file video.txt
6. Do the same with [VIDEO FOLDER 3]
At the end I'd like to get a video.txt file with the following contents:
[VIDEO FOLDER 1]
---[VFolder1]
---VideoFile1.avi
---VideoFile1.srt
---VideoFile1-ENG.srt
[VIDEO FOLDER 2]
---[VFolder2]
---VideoFile2.avi
---VideoFile2.srt
---VideoFile2-ENG.srt
[VIDEO FOLDER 3]
---[VFolder3]
---VideoFile3.avi
---VideoFile3.srt
---VideoFile3-ENG.srt
And when this is done, eject the CD/DVD.
Question:
In first round I try something like that:
sel a; #1048; wait 500; #102; writefile("test_A.txt", "<clipboard>");
I get something like that in txt file:
---[VFolder1]
---VideoFile1.avi
---VideoFile1.srt
---VideoFile1-ENG.srt
BUT how can I append the next text to this txt file
when I open the the [VIDEO FOLDER 2]?
My txt file should look like this:
---[VFolder1]
---VideoFile1.avi
---VideoFile1.srt
---VideoFile1-ENG.srt
---[VFolder2]
---VideoFile2.avi
---VideoFile2.srt
---VideoFile2-ENG.srt
[VIDEO FOLDER 1]
---[VFolder1]
---VideoFile1.avi
---VideoFile1.srt
---VideoFile1-ENG.srt
[VIDEO FOLDER 2]
---[VFolder2]
---VideoFile2.avi
---VideoFile2.srt
---VideoFile2-ENG.srt
[VIDEO FOLDER 3]
---[VFolder3]
---VideoFile3.avi
---VideoFile3.srt
---VideoFile3-ENG.srt
So when I open my CD/DVD I see this
[VIDEO FOLDER 1]
[VIDEO FOLDER 2]
[VIDEO FOLDER 3]
I'd like to write such a script that does the followings:
1. Open [VIDEO FOLDER 1]
2. Select all the files and folders inside it.
3. Copy the names of them with the file sizes in KB (bytes) into a .txt file.
That is I'd like to get a video.txt file with the following contents:
[VIDEO FOLDER 1]
---[VFolder1]
---VideoFile1.avi --> Size: 338 854 KB (346 986 494 bytes)
---VideoFile1.srt --> Size: 1 KB (347 bytes)
---VideoFile1-ENG.srt --> Size: 1 KB (347 bytes)
Then
4. Go to the next folder [VIDEO FOLDER 2]
Get the same information like at [VIDEO FOLDER 1]
5. Append this new text information to the file video.txt
6. Do the same with [VIDEO FOLDER 3]
At the end I'd like to get a video.txt file with the following contents:
[VIDEO FOLDER 1]
---[VFolder1]
---VideoFile1.avi
---VideoFile1.srt
---VideoFile1-ENG.srt
[VIDEO FOLDER 2]
---[VFolder2]
---VideoFile2.avi
---VideoFile2.srt
---VideoFile2-ENG.srt
[VIDEO FOLDER 3]
---[VFolder3]
---VideoFile3.avi
---VideoFile3.srt
---VideoFile3-ENG.srt
And when this is done, eject the CD/DVD.
Question:
In first round I try something like that:
sel a; #1048; wait 500; #102; writefile("test_A.txt", "<clipboard>");
I get something like that in txt file:
---[VFolder1]
---VideoFile1.avi
---VideoFile1.srt
---VideoFile1-ENG.srt
BUT how can I append the next text to this txt file
when I open the the [VIDEO FOLDER 2]?
My txt file should look like this:
---[VFolder1]
---VideoFile1.avi
---VideoFile1.srt
---VideoFile1-ENG.srt
---[VFolder2]
---VideoFile2.avi
---VideoFile2.srt
---VideoFile2-ENG.srt