Date: Thu, 25 Jan 1996 12:17:35 -0700 From: david@pacific.net (david smith) Subject: script tips contributions: multi-volume CDroms
Extended to also detect which disk of a multi-volume set is in.
Uses a function called "getNthFileNameInFolder()" and a
dummy file placed on
the disk which is alphabetically first.* The last character of the
dummy file name
is changed to match the various volume names, e.g. alpha.xx1
alpha.xx2 alpha.xx3 .
*Special Note: The order in which a PC stores files in a particular directory is IN THE ORDER IN WHICH THEY WERE COPIED TO THAT DIRECTORY. If they were moved all at once, they will be in alphabetical (ASCII) order. If, however, you copy a file to a directory which already contains files, it will be LAST IN THE LIST. Knowing this bit of DOS trivia may save you several hours of debugging. We mention this because it is relevant to the script below. Therefore, copy the dummy file to its directory first, OR copy the whole directory of stuff at once, OR create a 2nd directory inside containing only the dummy file to insure its order.
SCRIPT:
on driveLetter
-- adapted (08-95) from code provided by:
-- Date: Mon, 5 Jun 1995 12:28:47 GMT+0200
-- From: Daniel Devolder Barcelona, Spain
-- ddevolder@CEDSERVER.UAB.ES
-- also, determine which volume (1,2,3) of the three-volume CD set
-- by last character of dummy file
--
global DOSdriveltr, CDvolume
repeat with i=68 to 91 -- search on letter "D" to "Z"
put getNthFileNameInFolder (numToChar (i) & ":\linkstuf\", 1) into fname
if char 1 to 10 of fname = "aacilnrt.u" then exit repeat
end repeat
if i < 91 then -- drive found
put char 11 of fname into CDvolume -- 11th char of dummy file is 1,2,
or 3 == volume
put numToChar (i) into DOSdriveltr
else -- no CD-ROM in drive
put "" into DOSdriveltr
end if
return DOSdriveLtr
end driveLetter
EXAMPLE:
on startstuff
put driveletter() & "\goodies\" into pathloc
end
-- pathloc would end up with "E\goodies\" in it.
David Smith Nine Trees Design
graphics.typography.interactive multimedia
e-mail david@pacific.net
web site http://www.pacific.net/~david/