Resetting Hard Drive Names
Resetting Hard Drive Names
- Subject: Resetting Hard Drive Names
- From: "Andrew W. Johnson" <email@hidden>
- Date: Wed, 9 Jan 2002 10:45:35 -0500 (EST)
Hello,
I asked about a script some time ago in the Apple Discussions -
AppleScript, and Hugh was nice enough to offer an explanation. I was
asking about resetting the Hard Drive names on lab computers in case the
students would mess them up (which does happen). I was offered the
following script:
(begin)
property real_name : alias "drive name:"
tell application "Finder" to set name of real_name to "drive name"
(end)
This works fine on my computer (my first test machine.) Since I have
multiple drives and partitions (a mixture of SCSI and IDE drives), I
expanded the script to cover all the Volumes, and works like a charm.
However, I ported the script over to our lab clone machine I have sitting
next to me, and I get a bizarre occurrence, where it never re-names one of
the Volumes, but renames the start up volume twice.
Our clone machine has 2 Hard Drives. The SCSI ID 0 is a 9 gig drive
partitioned into 3 Volumes. A 2 gig "Local HD", a 32MB "Admin", and a 6
or so gig "Documents". SCSI ID 1 has one partition called "Video HD".
This is the script that I am running:
(Begin)
property real_name1 : alias "Local HD:"
property real_name2 : alias "Video HD:"
property real_name3 : alias "Documents:"
property real_name4 : alias "Admin:"
tell application "Finder" to set name of real_name1 to "Local HD"
tell application "Finder" to set name of real_name2 to "Video HD"
tell application "Finder" to set name of real_name3 to "Documents"
tell application "Finder" to set name of real_name4 to "Admin"
(End)
If I run the script with out scrambling the Volume names, it works. If I
mess up any volume name besides the "Video HD" volume, it also
works. However, the minute I put in miscellaneous letters for the Volume
names, including the "Video HD" this time, "Local HD" gets the name "Video
HD" even after the first line of the script resets the "Local HD" back to
"Local HD". The script never touches the "Video HD", leaving it to
whatever messed up word I gave it. I was using the Script Debugger Demo,
and everything seems fine.
When I run this on my own machine, I don't have a problem, however I have
one FireWire VST drive, 2 IDE drives, and one SCSI drive, with two
partitions on my slave IDE drive.
The Lab clone is a Blue and White G3 with OS 9.1 installed.
If anyone can offer some insight I would be thankful.
Thanks,
Andrew W. Johnson
Assistant Macintosh Systems Administrator
Instructional Computing
080 Student Union
Stony Brook, NY 11794-3200
email@hidden