[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: Deep <Info@...>
Date: Mon, 16 May 2011 06:37:00 +0100
An alternative method using Unix command line and then embed that command
inside the FB program using "Open Unix..." as a suggestion?

To get all metadata for a file, just use the "mdls" command:

mdls /my/path/filename

This will list all metadata, and then parse the text as required.

To look for a specific metadata such as Finder Comments:

mdls -name kMDItemFinderComment /my/path/filename

The Unix may be easier to embed inside a "Open Unix..." command within FB.



> From: Ken Shmidheiser <kshmidheiser@...>
> Reply-To: <futurebasic@...>
> Date: Mon, 16 May 2011 00:42:16 -0400
> To: <futurebasic@...>
> Subject: Re: [FB] API for Finder: Get Info 'More Info'
> 
> 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:
> 
> #if ndef _DEFINEDINCARBON
> #define MDItemRef as pointer // to struct MDItem
> #endif
> 
> 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.
> 
> 
http://developer.apple.com/library/mac/samplecode/SpotlightAPI/SpotlightAPI.zi>
p
> 
> It would be nice if we could get it to work here.
> 
> Ken
> 
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
> To access the list archives, go to:  http://freegroups.net/groups/futurebasic/