Hi, all.
In an attempt to find out the origin of the file (tested with .doc file), I wrote the following code:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions
set aFile to choose file
set fileManager to a reference to current application's NSFileManager's defaultManager()
set aDictionary to fileManager's attributesOfItemAtPath:(POSIX path of aFile) |error|:(missing value)
set extendedAttributes to aDictionary's NSFileExtendedAttributes
set whereFrom to extendedAttributes's |com.apple.metadata:kMDItemWhereFroms|
set whereFrom to my ASDataFromData:whereFrom
on ASDataFromData:theData
set theCode to current application's NSHFSTypeCodeFromFileType("'rdat'")
return (current application's NSAppleEventDescriptor's descriptorWithDescriptorType:theCode |data|:theData) as data
end ASDataFromData:
As you see, I get the result as NSData, then as raw data. But how can I get this extended info in the human-readable form?