get "type" of disk i.e. CD, DVD, zip...
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