0

I have a macOS app and I can access the file comment and get it to display, but how do I edit it and have this edit get added to the comment so when I revisit the file, the comment is updated to what I updated it to in my app? Is there an easy way to do this?

My code is here:

    let mditem = MDItemCreateWithURL(nil, url! as CFURL)
    var comment = MDItemCopyAttribute(mditem, kMDItemFinderComment)
    updateComment = commentBox.stringValue as CFTypeRef

updateComment is the thing that isn't working for me at this stage.

plastik_cards
  • 63
  • 2
  • 6
  • Unfortunately your question only contains requirements: it is not showing any efforts from your side to solve this problem yourself. Please [edit] your question to show [your attempt far](http://whathaveyoutried.com), and you'll be much more likely to receive answers that help you progress. Show us your work so far as a [mcve], the result you were expecting and the results you got, and we'll help you figure it out. It may help to re-read [ask]. – Toby Speight Oct 05 '18 at 06:59
  • Your previous question https://stackoverflow.com/q/52658483/1187415 (now deleted) was closed as a duplicate of https://stackoverflow.com/q/34711066/1187415, which has an answer with Swift code to both get and set the finder comment. Did you try that one? – Martin R Oct 05 '18 at 07:03

0 Answers0