Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
DirectInteraction Xtra.
NAB - 'Not Another Button'
Foundation Director 8.5
All in one video controller
MADPlayer
Animate Image Sequence
Moving MIAWs with lingo
Get System Time
Dress Up
SM sprite scroll
 

 

 

Behavior Find a drive with a specific name/Find CD Drives

Added on 10/2/2000

 

Compatibilities:
D7 D8 PC Script

Required Xtras:
Buddy API
FileXtra

This item has not yet been rated

Author: MediaMacros (website)

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

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail