home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 3
/
AACD03.BIN
/
AACD
/
CDROM
/
ReadCDTitles
/
ReadTitles.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-01-01
|
2KB
|
88 lines
/* ReadTitles.rexx v1.1 © 1996-97 Roy E Brown <roy@ebrown.demon.co.uk> */
/* $Ver: ReadTitles.rexx V1.1 (1.1.97) */
/* One thing that has always annoyed me about song catalogs for the various CD
players is that you cannot identify the CD's just by looking at the
filenames - ID10300A32042737 is totally meaningless. :(
This script can read song files (with filenames like ID10300A32042737 etc),
get the artist and title of the CD and write them both as a filenote to the
file. This makes it easier to identify a particular CD song file - especially
using DOpus 5 or similar.
New for V1.1 - you can now write the output to a separate index file.
*/
/* Set this the first characters of the filename that are common to all
filenames - need only be the first one or two. Leave the '#?' in place. */
FileStart="ID#?"
/****** No need to touch anything below this line ******/
Options FailAt 21
n=0
lf='0a'x
If ~Show('L',"rexxreqtools.library") Then
AddLib('rexxreqtools.library',0,-30,0)
DiskDir=RTFILEREQUEST(,,'Select your Disks directory..',,'rtfi_flags=freqf_nofiles')
If rtresult=0|DiskDir='' Then Exit
If ~Exists(DiskDir) Then
Do
Say "Directory not found"
Exit
End
a=Pragma("D",DiskDir)
Call RTEZREQUEST(" Write output as a file comment "lf,
" or to an index file?",,
"Comment|File|Cancel","ReadCDTitles V1.1 ©1996-97 R E Brown",,
"rt_reqpos=reqpos_centerscr","Dest")
If Dest=0 Then Exit
Address Command 'List 'FileStart' LFormat %N > T:DiskList'
Address
Call Open(list,"T:DiskList")
Do While EOF(list)=0
n=n+1
File.n=Readln(list)
End
Do x=1 to n-1
Call Open(name,File.x)
CD.Artist=Readln(name)
CD.Title=Readln(name)
Comment=CD.Artist||' - '||CD.Title
If Dest=1 Then
Address Command 'Filenote 'File.x' "'Comment'"'
Else
Do
Call open(index,DiskDir||'RCDIndex',w)
Call WriteLn(index,Comment)
End
call Close(name)
End
If Dest=2 Then
Done=" The index has been witten as "lf||DiskDir||"RCDIndex"
Else
Done="The CD Titles and Artists have "lf"been written as file comments"
Call RTEZREQUEST(Done,"Thank You","ReadCDTitles V1.1 ©1996-97 R E Brown",,
"rt_reqpos=reqpos_centerscr")
a=Close(list)
Address Command 'Delete >NIL: T:DiskList'
Exit