Re: Resetting Hard Drive Names
Re: Resetting Hard Drive Names
- Subject: Re: Resetting Hard Drive Names
- From: "Marc K. Myers" <email@hidden>
- Date: Wed, 09 Jan 2002 16:31:00 -0500
- Organization: [very little]
>
Date: Wed, 9 Jan 2002 10:45:35 -0500 (EST)
>
From: "Andrew W. Johnson" <email@hidden>
>
To: email@hidden
>
Subject: Resetting Hard Drive Names
>
>
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.
The first time you run this script on any machine it should be newly
compiled on that machine and the names of the volumes must match the
volume names in the four properties at the top of the script. The way
this script works, when it is compiled the aliases are replaced
internally by absolute identifiers for the volumes that will find them
even if they are renamed. By running a copy compiled on another machine
you may not have those aliases pointing to the correct volumes or any
volumes at all.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[1/9/02 4:30:27 PM]