• 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
get "type" of disk i.e. CD, DVD, zip...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

get "type" of disk i.e. CD, DVD, zip...


  • Subject: get "type" of disk i.e. CD, DVD, zip...
  • From: Brendan Wilde <email@hidden>
  • Date: Sat, 20 Nov 2004 09:50:59 +1100

I am guessing this is really easy but haven't been able to find the answer anywhere.
I am trying to find out the type of a disk i.e. CD, DVD etc

I looked the "Finder" dict. and through the properties for a disk and came up with this,
which seems like it might work? There must be an easy method
to figure out if a disk is a CD, DVD, Hard Drive, zip etc...
(sorry if this has been brought before...)

tell application "Finder"
set disk_ to (choose folder with prompt "Pick any disk")
try
set capacity_ to capacity of disk_ as text
if capacity_ contains "E+8" then --
or E+7?
display dialog "is this a CD?"
else if capacity_ contains "E+9" then
display dialog "is this a DVD?"
else if capacity_ contains "E+10" then
display dialog "is this a hard disk?"
end if
end try
end tell



thanks
Brendan
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: get "type" of disk i.e. CD, DVD, zip...
      • From: Graff <email@hidden>
  • Prev by Date: Re: Deleting last item of a List
  • Next by Date: Re: Deleting last item of a List
  • Previous by thread: Script won't open from Dock
  • Next by thread: Re: get "type" of disk i.e. CD, DVD, zip...
  • Index(es):
    • Date
    • Thread