I hope you find this useful, I did something like this a while ago, of course, can't find the code.. So I've rebuilt it.. I think this a bit different.. This looks a bit dirty, but if you call on this function, you'll get an applescript record as the result. then you can just call on the variable, which matches the mdls name ..
set recordResult to getMDLSDetails("/Users/me/Pictures/IMG_0123.JPG")
set intHeight to kMDItemPixelHeight of recordResult
on getMDLSDetails(strFilePath)
set strCommandResult to do shell script "mdls " & (quoted form of strFilePath)
set strCommandResult to replaceText(strCommandResult, "," & return, ", ")
set strCommandResult to replaceText(strCommandResult, "(" & return, "")
set strCommandResult to replaceText(strCommandResult, return & ")", "")
set lstItems to paragraphs of strCommandResult
set lstScriptItems to {}
repeat with strLine in lstItems
if strLine contains "Date" then --> convert to strings
set strLine to replaceText(strLine, "=", "=\"") & "\""
else if strLine contains "kMDItemContentTypeTree" then --> create list
set strLine to replaceText(strLine, "=", "={") & "}"
else if strLine contains "kMDItemFSName" then --> seems to be a bug in mdls
set strLine to strLine & "\""
end if
set strLine to replaceText(strLine, "=", ":")
set lstScriptItems to lstScriptItems & strLine
end repeat
set AppleScript's text item delimiters to ", "
set strScript to lstScriptItems as string
set AppleScript's text item delimiters to ""
set strScript to "{" & strScript & "}"
return run script strScript
end getMDLSDetails
on replaceText(strText, strCharactersToReplace, strReplacementCharacters)
set AppleScript's text item delimiters to strCharactersToReplace
set lstOriginalTextItems to text items of strText
set AppleScript's text item delimiters to strReplacementCharacters
set strResult to lstOriginalTextItems as string
set AppleScript's text item delimiters to ""
return strResult as Unicode text
end replaceText