Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Enthusiast Zone > Classic Macs and Mac OS > Nagging Little Questions...

Nagging Little Questions...
Thread Tools
Fresh-Faced Recruit
Join Date: Sep 2000
Status: Offline
Reply With Quote
Nov 30, 2000, 10:34 AM
 
Guys and gals, just a few questions I need some answers to. Nothing really crucial, but it could help...

Ok, I work as the techboy for a school system, and this is a problem more in the middle school I work in during the mornings. Essentially, we have a setup where users use logins that rely heavily on AppleScript, which rules, and it pulls up menus of apps to get to, the kids saving on the server.

The problem with this is that if the kids change the hard drive name, the the script barfs and returns errors. This isn't cool, since usually it's one teacher trying to keep 25 kids who desperately need Ritalin in line.

So, is there a utility out there that protects the hard drive name and doesn't simply let the kids click on it, start typing and change the names to "Pokemon" or "Stone Cold"? Has anyone heard of this? Thanks.

Chris

------------------
     
Grizzled Veteran
Join Date: Mar 2000
Location: Massachusetts, USA
Status: Offline
Reply With Quote
Nov 30, 2000, 10:44 AM
 
Here is a quick and dirty way: If you turn File Sharing on you cannot change the name of volumes until it is turned off. Keep in mind you don't actually have to share anything, just have Sharing turned on from the control panel.
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Dec 1, 2000, 05:11 AM
 
If you're already using AppleScript, there's several options you have, including having the script check the current name of the hard drive and build the pathnames dynamically.

i.e. instead of using:

tell application "Finder"
Open alias "Macintosh HD:Folder:Application Name"
end tell

just:

tell application "Finder"
set diskName to name of first disk
open alias (diskName & ":Folder:Application Name"
end tell

That way it'll catch whatever the disk name is at runtime, regardless of what it was when your script was written.

Another option would be to create aliases to the files you want and store those items in a new folder in the System Folderrefereneces folder. There's a built-in script command 'path to preferences' to find the current system preferences folder, regardless of disk name. This works regardless of disk name or even system language (the System Folder isn't called the same thing in the French version of the MacOS). In addition, this supports Multiple Users, so will locate the preferences folder of the current user, which may be useful to you.

Possibly the simplest (and tackiest) solution is to have your script rename the disk name back to a known value when it starts. That way you know what it's called, but it does detract from the flexibility of the MacOS... I couldn't live in a world where everyone's disk was named "C:"

Andrew
Gods don't kill people - people with Gods kill people.
     
Clinically Insane
Join Date: Apr 2000
Status: Offline
Reply With Quote
Dec 1, 2000, 06:08 AM
 
Or just tell it to use "Startup disk"

ie.

tell application "Finder"
select file "whatever" of startup disk
end tell

and you get the idea...

Cipher13
     
Fresh-Faced Recruit
Join Date: Nov 2000
Location: Brooklyn
Status: Offline
Reply With Quote
Dec 3, 2000, 02:04 PM
 
Speaking of apple scripts....

I have a script that moves everything on my desk top to a desired position at start up. Really great to use w/ cool desktop pix. There is a problem w/ my script tho: If I have 2 CDs in, or I have 1 CD and a zip disk, I can only get the script to set both items in the same place... see:

if (count of every disk of desktop) > 4 then -- 4 = number perminent volumes
select (every disk of desktop whose ejectable is true and startup is false)
set position of selection to {297, 689}
end if

That sets every non-perminent volume (shared volume, CD or Zip) to a single spot. The perminent volumes are easy cause I can name them in the script and get them to be placed in their own location. I could use "set 2ndname to name of second disk" etc to get names of all mounted volumes, but the problem come when the number of volumes changes (ie: i have a CD in but not a zip disk). If I set the script to "set name of sixthdisk to sixth disk" and there is no sixth disk the script chokes ( "Finder got an error: can't get disk 6").

So the question is: How do I get the script to give all removable volumes their own location on the desktop even when the names and number of removable volumes change?

-Al
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 09:00 PM.
All contents of these forums © 1995-2015 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2015, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2