getting contents of CDs

I want to write a short script which will copy a selection of files (filenames) to the clipboard, get the name of the CD then activate Word or text edit and paste the disk name, followed by the clipboard contents and ‘–END’. I will run the script after inserting each CD. (I have 800+ data CDs to get through.)

I have never scripted before, but I do know the general ins and outs.

Thanks,
Neill

First, avoid the clipboard. It is completely unnecessary for this process.

Secondly, while you can build a script that periodically dumps data into a Word/TextEdit/whatever app document, it’s much easier to write the data to disk directly (e.g. to a text file) and just open that text file when you’re done.


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Thanks, Camelot - works fine!

Hi Camelot,

Before I start again… I modified the code you gave me and perfected the file layout to my requirements… and saved the file as an .app to use and a .scpt to keep the source code.

Apparently .scpt was wrong! Is there anyway to decompile the .scpt file so I can get the source code back? I really don’t want to do everything again!

Hope you can help!

You may want take a look to “quick catalog” or “hierarchical catalog” included in the package kapullo, under the category “Utils”.
Here is sample output from “quick catalog”:

Base folder:  / Users / julifos / Desktop / CD / 
inode  blocks   perm    linx  owner  group       bytes   modif.      fullpath
4199891    0 drwxr-xr-x    5 julifos  julifos       170 Dec 28 13:42 
4199897   16 -rw-r--r--    1 julifos  julifos      6148 Dec 28 13:42 /.DS_Store
4199893    0 drwxr-xr-x    5 julifos  julifos       170 Dec 28 13:42 /dir 1
4199904   16 -rw-r--r--    1 julifos  julifos      6148 Dec 28 13:42 /dir 1/.DS_Store
4199895    0 drwxr-xr-x    5 julifos  julifos       170 Dec 28 13:42 /dir 1/subdir 1
4199903   16 -rw-r--r--    1 julifos  julifos      6148 Dec 28 13:42 /dir 1/subdir 1/.DS_Store
4199902   16 -rw-r--r--    1 julifos  julifos      3017 Oct 14 19:01 /dir 1/subdir 1/file 1.txt
4199905   16 -rw-r--r--    1 julifos  julifos      3017 Oct 14 19:01 /dir 1/subdir 1/file 2.txt
4199896    0 drwxr-xr-x    4 julifos  julifos       136 Dec 28 13:42 /dir 1/subdir 2
4199906   16 -rw-r--r--    1 julifos  julifos      3017 Oct 14 19:01 /dir 1/subdir 2/file 1.txt
4199907   16 -rw-r--r--    1 julifos  julifos      3017 Oct 14 19:01 /dir 1/subdir 2/file 2.txt
4199894    0 drwxr-xr-x    4 julifos  julifos       136 Dec 28 13:42 /dir 2
4199901   16 -rw-r--r--    1 julifos  julifos      6148 Dec 28 13:42 /dir 2/.DS_Store
4199899   16 -rw-r--r--    1 julifos  julifos      3017 Oct 14 19:01 /dir 2/file.txt

And output from “hierarchical catalog”:

julifos:Users:julifos:Desktop:CD:
dir 1/
	subdir 1/
		file 1.txt
		file 2.txt
	subdir 2/
		file 1.txt
		file 2.txt
dir 2/
	file.txt
  • You can try opening both “.scpt” and “.app” from your script editor. If it doesn’t work, you saved as “run-only” and you lost the source code.