on open dropList
if (count items of dropList) > 1 then
beep
delay 1
return
end if
set diskAlias to (item 1 of dropList) as alias
tell application "Finder"
if (class of item diskAlias) is not disk then
display dialog "That is not a disk." buttons {"OK"} default button 1
return
end if
end tell
quoted form of (POSIX path of diskAlias)
set response to do shell script "bless -info " & the result
set AppleScript's text item delimiters to {"Blessed System Folder is "}
try
set response to text item 2 of response
on error
display dialog "This disk does not have an installed system." buttons {"OK"} default button 1
return
end try
set AppleScript's text item delimiters to {return}
set response to text item 1 of response
set systemFile to ((POSIX file response) as alias as text) & "SystemVersion.plist"
tell application "System Events" to set systemRecord to (value of property list file systemFile)
set sysVersion to (ProductVersion of systemRecord)
set buildNr to (ProductBuildVersion of systemRecord)
display dialog "Mac OS version " & sysVersion & " (" & buildNr & ")" buttons {"OK"} default button 1
end open
INFO MODE
To gather information about the currently selected volume (as determined
by the firmware), suitable for piping to a program capable of parsing
Property Lists:
bless --info --plist
But "--" won't work in AppleScript, so I used "-info" and it seems to work.
Perhaps someone knows more about this. (?)