[futurebasic] Re: [FB] API for Finder: Get Info 'More Info'

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2011 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Mon, 16 May 2011 00:42:16 -0400
Like Brian, I agree that MDItems should work. However, I have not 
been able to translate the necessary MDItem.h header functions to FB. 
My definitions:

#define MDItemRef as pointer // to struct MDItem

toolbox fn MDItemCreateWithURL ( CFAllocatorRef allocator, CFURLRef 
url ) = MDItemRef
toolbox fn MDItemCopyAttributeNames ( MDItemRef item ) = CFArrayRef
toolbox fn MDItemCopyAttributes ( MDItemRef item, CFArrayRef names ) 
= CFDictionaryRef

all fail with:

Error: gcc: implicit declaration of function 'MDItemCreateWithURL' in 
fn 'main' [line 27 of _1_Get_Info_as_metadata,Get_Info_as_metadata.m]

I have tried linking the AppKit frameworks, and even wrapping the C 
code, but can't get it to work. Perhaps R.P. can weigh in here.

At any rate, here is a like to an Xcode project that does work. When 
compiled in Xcode, it creates an app with a window. Drag and drop a 
file into the window, and Get Info and other metadata is shown.


It would be nice if we could get it to work here.