excluding volume names from command - list disks

Hello All,
I would like to exclude known volume names from list disks.
If I have volumes: 1, 2, 3 and 4 and would like to exclude 4 from the following script. How would I do it?
– start script set dlist to list disks --command to exclude 4 display dialog dlist – end script
I would like only 1, 2 and 3 to display.
Is this possible?
Thank you,
Damon

: Hello All,
: I would like to exclude known volume names from list disks.
: If I have volumes: 1, 2, 3 and 4 and would like to exclude 4 from
: the following script. How would I do it?
: – start script set dlist to list disks --command to exclude 4
: display dialog dlist – end script
: I would like only 1, 2 and 3 to display.
: Is this possible?
There may be a better way but this appears to work ok.
– [b:000]Example 1[/b:000] – Begin Code – To exclude one disk
tell application “Finder” to set dlist to name of every disk whose name is not “4”
– End Code –

– [b:000]Example 2[/b:000] – Begin code – to exclude more than one disk
set excludedDisks to {“1”, “4”}
tell application “Finder” to set dlist to name of every disk whose name is not in excludedDisks
– End Code –
FYI, tested on Mac OS 9.1/AppleScript 1.6 with 6 disks available.
Later,
Rob J

I just noticed that Example 2 will not return a list if the result
contains only one item. To overcome this, use:
– Begin modified code –
set excludedDisks to {“1”, “4”}
tell application “Finder” to set dlist to (name of every disk whose name is not in excludedDisks) as list
– End modified code –
Later,
Rob J

Thanks Rob,
Your code worked perfect.
Thanks again,
Damon