Re: Getting Individual Metadata Items with ASObjC
Re: Getting Individual Metadata Items with ASObjC
- Subject: Re: Getting Individual Metadata Items with ASObjC
- From: Shane Stanley <email@hidden>
- Date: Fri, 10 Jun 2016 22:37:47 +1000
On 10 Jun 2016, at 7:20 PM, Christopher Stone <email@hidden> wrote:
The relevant bit is this:
# Get the Spotlight metadata set theNSMetadataItem to current application's NSMetadataItem's alloc()'s initWithURL:anNSURL set theAtts to theNSMetadataItem's attributes() set theMetadata to theNSMetadataItem's valuesForAttributes:theAtts attsNSMutableDictionary's addEntriesFromDictionary:{SpotlightData:theMetadata}
But I can't figure out how to return one or more metadata keys instead the whole thing.
At the moment I'm specifically looking for kMDItemWhereFroms.
You can use this:
set theNSMetadataItem to current application's NSMetadataItem's alloc()'s initWithURL:anNSURL set theMetadata to theNSMetadataItem's valueForAttribute:"kMDItemWhereFroms"
The attributes are effectively the keys to a dictionary.
--
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden