Re: Droplet for CD
Re: Droplet for CD
- Subject: Re: Droplet for CD
- From: Jolly Roger <email@hidden>
- Date: Wed, 19 Sep 2001 11:14:40 -0500
On 9/19/2001 9:57 AM, "Sprague, Graham" <email@hidden> wrote:
>
if (disk of the (info for this_item) is true) then
Hi Graham,
The "info for" command returns a "file information" record. There is no
"disk" field in the "file information" class defined in Standard Additions.
So that's not going to work. The "info for" command doesn't return any
useful information for this purpose.
I would suggest instead using Akua Sweets "disk volume info" command to
obtain a "Volume Info Rec" record, and examining the "vol device kind" field
of the record to determine if it is a CD. If it = cd volume, then you have
a CD.
Note: You could also use the "vol alias" field to obtain an alias to the
actual volume, which would allow users to drag *any* file or folder on the
volume to your droplet.
Check this out (watch for line wraps):
-- begin script
on open itemList
repeat with i from 1 to the count of itemList
set nextItem to item i of itemList
set the volumeInfo to the disk volume info for (nextItem as text) --
Akua Sweets
set volumeAlias to the volumeInfo's vol alias -- Akua Sweets
if the volumeInfo's vol device kind is cd volume then -- Akua Sweets
display dialog ("\"" & (volumeAlias as text) & "\" is a CD.")
buttons {"OK"} default button 1
else
display dialog ("\"" & (volumeAlias as text) & "\" is not a
CD.") buttons {"OK"} default button 1
end if
end repeat
end open
-- end script
HTH
JR