Finder Comments Not Appearing on some Indexed Files

Here’s my attempt to run mdls:

StevensMacMini2020M1:~ stevej$

StevensMacMini2020M1:~ stevej$ mdls /Users/stevej/MyExperience/Media Files/Video MP4 from 8mm VHS Hi8/00 2 CR5 Summer CR5 Allison stayover Steve Allison Cindy 7Min.mp4

/Users/stevej/MyExperience/Media: could not find /Users/stevej/MyExperience/Media.

I used copy path from Finder

Names with spaces have to have the spaces escaped in Terminal. You’re better off dragging and dropping the file into Terminal after mdls and a space. Terminal will escape the characters it needs to. Alternately, use double straight quotes and paste the path in between them.

:+1:

OK. Drag and Drop into the terminal window worked very good. I tried several options. I tried 2 files where there was nothing showing in the Mac Finder Comments. For those files, mdls reported kMDItemFinderComment to be exactly as shown in DT3 Finder Comments (yet nothing showed in Mac Finder Comments). Then I tried 1 file where I had previously run the script and the Mac Finder Comments were showing as in DT3. For this, mdls reported kMDItemFinderComment = “” (no information). So then I tried going back into DT3, running the script on another file, which transferred visibly into Mac Finder Comments and for this one, mdls kMDItemFinderComment showed the correct text. That’s all I can handle right now. Thanks for all your help so far.

Yesterday, I’d posted a bit about mdls output from several files. I now understand why you were pushing for investigating the file metadata with mdls. And I did some more checks today. I wanted to get additional data and also replicate the earlier results where the Mac Finder Comments “disappeared” after Mac restart.

Thanks to both you and BLUEFROG for the script, but also how to install it in the DT3 Scripts.

Based on my testing, Interim conclusions follow.

The script generally works to update the kMDItemFinderComment field shown via terminal command “mlds”. However, immediately after running the script, kMDItemFinderComment = “” . But upon Mac restart, kMDItemFinderComment shows the same text as in DT3 Finder Comment. But there is a problem with Mac Finder Comments on some of the files - they disappear:

But I ran into an issue, on some of the files. Apparently when there is already content in the Mac Finder Comment, when the script is run, the Mac Finder Comment goes away. I tried 2 tests where I ran the script for 20+ selected files in DT3. All seemed well until I restarted my Mac. Then I noticed the Mac Finder Comments for some of the files was gone. On preliminary investigation, those were files that already had some text in the Mac Finder Comment. But even though the Mac Finder Comment was gone, when I ran mlds in Terminal the kMDItemFinderComment for those files is correct and agrees with the DT3 Finder Comment.

I also noticed that after running the script, when I ran mlds in terminal the kMDItemFinderComment field showed = “”, but after Mac restart kMDItemFinderComment field showed the same text as DT3 FinderComment. I can’t find a decent way within DT3 to see which files have Mac Finder Comments and which do not. Perhaps checking from Finder might work.

I’m thinking the best course of action would be to go into the Mac Directory that is indexed in DT3 and delete the comments from the files and then run the script. I would test it first.

There are other posts on that site about Finder bugs/peculiarities.

Thanks, I’ll check out the metadata post. By the way, my thought about clearing the comments out of files prior to running the script is a bad idea. I tried it for one file after backing up the data. I located one of the files where nothing showed in the Mac Finder Comments field. I then opened its File Info which showed the correct DT3 FinderComment data (even though nothing showed up in MacFinder Comments). I then deleted the text from Comments in File Info. Only to then discover that when I deleted the comments in Finder Info, it updated the files DT3 Finder Comments for that file and so they were also deleted. Leaving nothing for the script to update. There’s some sort of disconnect between MacFinder Comment, MacFileInfo Comment and kMDItemFinderComment. Updating one field doesn’t apparently update the other fields.

There is only one field. The output of mdls is the relevant info here. Everything else is just a GUI, and apparently not a reliable one.

Looks like I stumbled across the cause for the missing Comments in Mac Finder. It is "CR"s in the DT3 FinderComment field.

I was using File Info and looking for differences between the files with visible comments in Mac Finder and those where Mac Finder Comments were blank. I noticed that in the cases where Mac Finder Comments were blank, the File Info Comments showed a blank line resulting from my Carriage Returns in the text (just like I’d entered it in DT3 Finder Comments). Note: I’d use CR’s to separate the DT3 Finder Comments into “paragraphs” to provide more clarity about the file contents.

When I deleted the CR’s from the text in “File Info Comments”, the Comments immediately showed up in Mac Finder Comments. And I repeated this for several files with the same positive results.

During investigations I noticed that some of the comments in Mac Finder were partially visible, only 1/2 of the bottom half of text was visible. These were files where I’d only entered 1 CR, not the 2 CR’s necessary to produce a blank line.

As a test, I then tried entering text into “File Info Comments” in an unrelated file. I found out that It will not allow CR entries. It returns a chime sound if you try to enter CR. But it does accept CR’s that are entered in DT3 Finder Comments.

To deal with my particular issues, I’m going through all the 250 files, using DT3 and deleting all of the CR’s from Finder Comments (under Annotations & Reminders). It’s a tedious task but better than cut and paste, and much easier than doing one file at a time in File Info.

If I’d known, I would certainly have done things differently, but if a user didn’t need to see the Comment in Mac Finder, Mac File Info does show the full DT3 comment. And so Finder Search should include that content, even though it doesn’t show in Mac Finder Comment.

Alternatively, if DT3 Finder Comment carried the same entry restrictions as Mac File Info Comments, my particular issue wouldn’t have occurred. But if a user were only using DT3 as the interface with the indexed files, then the current state would be OK.

Some sort of warning or documentation would be helpful for DT3 users who are planning on using Finder Comments in their workflow.

DT should warn users about Finder shortcomings? In my mind, you’re barking up the wrong tree. kMDItemFinderComment is a string, and as such it allows \r, n and a whole lot of other characters. If Apple’s Finder isn’t up to displaying these strings, Apple should fix it.

You could’ve used a script to fix the metadata, btw. Lots faster than changing them manually.

1 Like

Not saying you are wrong in what you were doing. But I will say it’s more unusual to see, in my experience. Finder comments are often just short blurbs, e.g., Fred and Ethel M., 1953. :slight_smile:

May I ask why you opted to use Finder Comments?

PS…

image


Sure. For me, the longer filenames provided the short general details you indicate are normal for Comments. But for my particular case, I needed to document additional details about video files for friends and family who have Apple products but don’t have the DT3 app. I’m using DT3’s interface to add Finder Comments for the videos that include the people, place, event, year and month, and additional explanation if needed. Comments also include the original source file for the video as I have a variety of sources and formats. I also wanted the content to stay with the file when it’s copied and not require some other 3rd party app for finding or displaying content.

And I agree totally with your P.S. information. You can certainly add breaks, paragraphs etc within DT3, and it shows up just like that in File Info. But for my case and current Apple release, when there are CR’s in the DT3 Finder Comments, even though they show properly in File Info, the Comment is not visible in Mac Finder Comments.

I agree that this is and Apple issue. Just thinking about other DT3 users who might be trying to use DT3 Finder Comments with Mac Finder. And I sure wish I knew how to script the changes to get rid of CR’s, but I don’t. So, I’ll do it the hard way.

Thanks for all your help with this issue.

function performsmartrule(records) {
  records.forEach(r => {
    r.comment = r.comment().replaceAll(/[\r\n]/g,'');
  })
}

should do the trick, added as internal script to a smart rule which should select the records with a comment. I didn’t test it, though.

Since the Finder doesn’t display multi-line comments, are they truly useful in that capacity?

I also wanted the content to stay with the file when it’s copied and not require some other 3rd party app for finding or displaying content.

This would only be true on Apple-based systems, not across platforms.

1 Like

Thanks so much, I’ll give it a whirl

Thanks for the feedback. I didn’t know that Finder wouldn’t display multi-line comments - until I learned the hard way. And was figuring that it would be Apple Only. I’ve not tried using Google or Apple photos, but they may work.

Regarding the usefulness, you’re probably right. Since I now know the data is in the comments (as I can certainly see in File Info) a search should pick up records that match the search criteria. But I like looking down the file listing - if nothing shows, then I figure there are no comments.

A web based solution would likely be effective to address the cross platform issue, but I haven’t found one that suits for the various file formats I’m using. Some of the video files are pretty large and I don’t have decent high speed connection. I’ve used both Apple and Google photos, which might work for the Video and Image files, but my experience has not been good when the developers decide on major changes which lock me in to their systems. For example, while the changeover to Google Checkout works, it’s of modest value to me since I have to deal with the .json files. My data doesn’t change but the proprietary interface sure does. I’ve been trying to maintain control of the parent files on my local system. And that’s one important reason I use DT3. Prior to that I’d been a loyal Evernote customer but when they took everything online I left and welcomed the change to DT3.

Actually they should be visible in the Finder’s Info panel at least.

Yes, the comments are fully visible in File Info panel. However, since Mac Finder Comments appear to be blank, there’s no visual prompt to open File Info for the detail.