Mac Editing metadata with Cocoa

scorpsjl

macrumors newbie
Original poster
Jun 13, 2006
15
0
On another spotlight/metadata note, does anyone know how to edit metadata attributes with obj-C / Cocoa, given a file's url/path? I can't seem to pin it down. I'd like my app to be able to change various metadata attributes, as well as possibly add new ones. Anyone have any suggestions?

Thanks!
 

scorpsjl

macrumors newbie
Original poster
Jun 13, 2006
15
0
editing metadata

what if i just want to change the metadata for an individual file? How would I do that?

edit: I mean change the content, not edit the attributes themselves. Eg set the author datatype to author x, not change the author type itself.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
24,638
61
Harrogate
scorpsjl said:
what if i just want to change the metadata for an individual file? How would I do that?

edit: I mean change the content, not edit the attributes themselves. Eg set the author datatype to author x, not change the author type itself.
Depends on the specific type of file. There is no generic API for this. You need to understand the specific file structure of the file. This is why to get the meta-data OSX relies on vendor provided importers for each type. The importers are one-way though: you can't use them to write back to the files.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
24,638
61
Harrogate
scorpsjl said:
how about for PDF? Any way to do it?
What am I? Google?

Anyway Apple's PDFKit does not seem to provide these so you're either looking for a 3rd party library or Framework or implementing it on your own.