Each property list item can also contain other property list items. In your example,
you are using the value of one property list item (a record) as the key for getting
another property list item. You just need to break down each key/subitem - I use
to GetPlistElement from PlistItems
(*
get the specified element from a simple Plist structure by name or index
note that the indexes are not necessarily the order shown in the XML file (?!)
the number of items is not fixed, but must be at least 2 (the Plist file and a Plist element)
parameters: PlistItems [list] -
item 1 [mixed]: the Plist file path (Finder or POSIX)
item 2 [mixed]: the Plist element name or index (names are case sensitive)
item(s) 3+ [mixed]: additional sub item(s)
returns [mixed]: value of the element - null if not found or error
*)
try
tell application "System Events"
set thePlistElement to property list file ((get the first item of PlistItems) as text) -- start at the root element
repeat with AnItem in rest of PlistItems -- add on the sub items
set AnItem to the contents of AnItem
try
set AnItem to AnItem as integer -- index number?
end try
set thePlistElement to (property list item AnItem of thePlistElement)
end repeat
return value of thePlistElement
end tell
on error ErrorMessage number ErrorNumber
log ErrorMessage
return null -- error "GetPlistElement handler: element not found (" & ErrorNumber & ")"
end try
end GetPlistElement