title: Swift set “comment” from file’s “get info“ within swift
body: <p>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?</p>
  
  <p>My code is here:</p>
  
  <pre><code>    let mditem = MDItemCreateWithURL(nil, url! as CFURL)
      var comment = MDItemCopyAttribute(mditem, kMDItemFinderComment)
      updateComment = commentBox.stringValue as CFTypeRef
  </code></pre>
  
  <p>updateComment is the thing that isn't working for me at this stage. </p>