My task is to determine the name of mounted disk associated with a real disk (CD, DVD) inserted into CD/DVD drive.
I’ve set up the following Folder Action on /Volumes system folder:
on adding folder items to this_folder after receiving added_items
repeat with itemadded in added_items
display dialog itemadded as string
end repeat
end adding folder items to
This code displays me the name of every drive mounted regardless of its type (network, CD/DVD, USB etc.).
Could you advice me please any way to filter out drive names by type please?
on adding folder items to this_folder after receiving added_items
repeat with itemadded in added_items
tell application "Finder"
display dialog (get name of disk (text 1 thru -2 of (itemadded as text)))
end tell
end repeat
end adding folder items to