Editing metadata with Cocoa

Discussion in 'Mac Programming' started by scorpsjl, Jun 17, 2006.

  1. macrumors newbie

    Joined:
    Jun 13, 2006
    #1
    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!
     
  2. macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #2
    You'd have to replace the MDImporter for that file type.
     
  3. thread starter macrumors newbie

    Joined:
    Jun 13, 2006
    #3
    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.
     
  4. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    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.
     
  5. thread starter macrumors newbie

    Joined:
    Jun 13, 2006
    #5
    editing metadata with cocoa

    how about for PDF? Any way to do it?
     
  6. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    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.
     

Share This Page