• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Droplet for CD
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Droplet for CD


  • Subject: Re: Droplet for CD
  • From: Paul Skinner <email@hidden>
  • Date: Thu, 20 Sep 2001 09:54:51 -0400

on 9/19/01 1:12 PM, Paul Skinner wrote:

> on 9/19/01 10:57 AM, Sprague, Graham wrote:
>
>> I need to create a droplet that will only accept a CD. Does anyone know how
>> to do this. I tried the following to no avail...
>>
>> Any help would be great.
>>
>> Thanks,
>> Graham
>
> Not fool-proof but vanilla.
>
> --begin script
> set u to alias "Audio CD 1:"
>
> tell application "Finder"
> try
> tell disk u
> if kind is "disk" and ejectable is true and size is less than
> 657 and capacity is less than 657 and free space is 0.0 then set CDTest to
> "Probably a CD"
> end tell
> on error
> set CDTest to "Probably not a CD"
> end try
> end tell
> --end script

Paul, you are a slacker! This code doesn't work!

I should have run before I posted.
If you want to avoid OSAXen including imbedded, then you will have to
narrow the allowed items as much as AppleScript will allow.
This code will require a removable volume whose capacity and size are
less than the maximum size of verbatim 74min 650Mb CDR media recorded as a
disk not a session. I wouldn't check for minimum size greater than a certain
Mb to eliminate locked floppies due to the occasional small CDR and the
relative rarity of floppies here. YMMV.

--begin script

on open droppedItem
set droppedItem to item 1 of droppedItem
tell application "Finder"
try
tell disk droppedItem
set n to name
if kind is "disk" and ejectable is true and ,
size is less than 6.88932864E+8 and ,
capacity is less than 6.88932864E+8 and ,
free space is 0.0 then
set CDTest to " is probably a CD."
else
set CDTest to " is probably not a CD."
end if
end tell
on error
set CDTest to " is probably not a CD."
end try
end tell
display dialog n & CDTest
end open

--end script


--
"I have overcome my will- power and have taken up smoking again."
- Mark Twain [b. Samuel Langhorne Clemens] (1835 - 1910)


  • Follow-Ups:
    • Re: Droplet for CD
      • From: Jolly Roger <email@hidden>
References: 
 >Re: Droplet for CD (From: Paul Skinner <email@hidden>)

  • Prev by Date: RE: Droplet for CD
  • Next by Date: Re: International version
  • Previous by thread: Re: Droplet for CD
  • Next by thread: Re: Droplet for CD
  • Index(es):
    • Date
    • Thread