set curfile to getNthFileNameInFolder(curpath & "\", index)
if curfile = EMPTY then
set filefound to 0
exit repeat
end if
put fileName, curpath & curfile
if fileName = (curpath & "\" & curfile) then
set filefound to 1
exit repeat
end if
end repeat
return filefound
end
on getdrive
if the machineType < 256 then
set volumetext to OSVolumeList()
set vollist to cvtTextToList(me, volumetext)
else
set vollist to []
repeat with index = 3 to 26
set drive to numToChar(64 + index) & ":\"
add(vollist, drive)
end repeat
add(vollist, EMPTY)
end if
if the machineType = 256 then
set filesep to "\"
else
set filesep to ":"
end if
set drive to EMPTY
repeat with volume in vollist
if fileExists(volume & "Media\Main.dxr") then
set drive to volume
exit repeat
end if
end repeat
if drive = EMPTY then
alert("Your CD could not be found. Please insert it into the drive and try again.")
return 0
else
return drive
end if
end
on jumpMovie moviePath
global numtries
set numtries to numtries + 1
set drive to getdrive()
if stringp(drive) then
go(1, drive & moviePath)
else
if numtries < 3 then
jumpMovie(moviePath)
else
alert("The Next Generation CD could not be found. This program will now quit as gracefully as possible under the circumstances, though you should really try to get a copy of the Next Generation CD because it contains some truly cool stuff.")
halt()
end if
end if
end
on launch moviePath
global numtries
set drive to getdrive()
if stringp(drive) then
open(drive & moviePath)
else
if numtries = 1 then
open(moviePath)
else
alert("The Next Generation CD could not be found. This program will now quit as gracefully as possible under the circumstances, though you should really try to get a copy of the Next Generation CD because it contains some truly cool stuff.")
halt()
end if
end if
end
on getpath fileName
set olddelimiter to the itemDelimiter
set the itemDelimiter to "\"
set newpath to item 1 to the number of items in fileName - 1 of fileName