[MacRuby-devel] spotlight - MDItemRef
lsansonetti at apple.com
Tue Oct 27 17:31:32 PDT 2009
I'm afraid the MD* APIs haven't been covered by BridgeSupport yet, so
it may not be possible to call it directly from MacRuby at this point.
I would recommend to file a bug at http://bugreporter.apple.com so
that we can consider this for a future Mac OS X release, and to wrap
this C API into an Objective-C class that you can call from MacRuby in
On Oct 27, 2009, at 5:13 PM, Alan Skipp wrote:
> Would anyone be able to give me a hint on how to get the following
> objective-c code working with macruby. The code uses spotlight to
> extract metadata from a file.
> MDItemRef inspectedRef =
> CFArrayRef attributeNames = MDItemCopyAttributeNames(inspectedRef);
> NSLog(@"%@", (NSArray*)attributeNames);
> I was hoping that including the 'CoreServices' framework would work,
> no joy.
>>> framework 'CoreServices'
> => true
>>> item = MDItemCreate(KCFAllocatorDefault, '/Users/alan/Desktop/
> NameError: uninitialized constant KCFAllocatorDefault
> from core:in `const_missing:'
> from (irb):2:in `<main>'
> from core:in `eval:'
> from core:in `evaluate:'
> Alan Skipp
> al_skipp at fastmail.fm
> http://www.fastmail.fm - IMAP accessible web-mail
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
More information about the MacRuby-devel