|
|
|
Find a drive with a specific name/Find CD Drives
Added on 10/2/2000
|
The first function will search your drives and return the drive letter of the drive with the name specified. Use like this...
mydrive = findDriveNamed("MyCD")If no drive is found it returns ""
The second function returns a lit of all the CD drives on a system. Call like this...
CDdrives = findCDDrives()
on findDriveNamed whatName
drives = drivesToList()
repeat with x = drives.count down to 1
if baDiskInfo( drives[x], "Name" ) = whatName then
return drives[x]
exit
end if
end repeat
return ""
end
on findCDDrives
cdList = []
drives = drivesToList()
repeat with x = drives.count down to 1
if baDiskInfo( drives[x], "type" ) = "CD-ROM" then
add cdList, drives[x]
end if
end repeat
if cdList = [] then
alert("No CD Drives found or no discs loaded.")
else
return cdList
end if
end
on getBehaviorDescription me
describe = "The first function will search your drives and return the drive letter of the drive with the name specified. Use like this..." & return & "mydrive = findDriveNamed(" & quote & "MyCD" & quote & ")" & "If no drive is found it returns " & quote & quote & return & "The second function returns a lit of all the CD drives on a system. Call like this..." & return & "CDdrives = findCDDrives()" & return & "Both require the freeware fileXtra - free with Dir 6.5 and 7"
return describe
end
|
|