Re: How to choose a hard disk or volume?
Re: How to choose a hard disk or volume?
- Subject: Re: How to choose a hard disk or volume?
- From: Nigel Garvey <email@hidden>
- Date: Thu, 14 Dec 2000 11:23:37 +0000
Gary Hobish wrote on Wed, 13 Dec 2000 18:37:30 -0800:
>
I want the user to choose a volume within a script. I have tried:
>
>
set localDisk to (choose disk with prompt "Choose your startup disk.")
>
>
but I get an error when checking syntax on the word "disk" which says
>
"Expected "," but found identifier."
>
>
I tried the same thing with the word "volume" replacing "disk" but got the
>
same error.
>
>
Any ideas?
>
>
Also, how would I go about telling a system to restart from a script?
There's no 'choose disk' command (not in 8.6 anyway), so the compiler's
confused about the word 'disk' coming after the word 'choose'. You can
lash up your own disk-input request like this:
set localDisk to (choose from list (list disks) with prompt "Choose
your startup disk.")
The result is either 'false' (if the Cancel button was clicked) or the
name of the selected disk, in a list, something like:
{"Macintosh HD"}
You can get the current startup disk without user input:
set stupDisk to (path to startup disk)
>
Also, how would I go about telling a system to restart from a script?
tell application "Finder" to restart
I assume though that you're trying to script the computer to restart from
a selected volume - which I'm not sure is possible.
NG