Finder Comments Not Appearing on some Indexed Files

Using Mac Sonoma 14.1.2 and DT 3.9.4.

I’ve indexed the files in a folder on my Mac for my DT3 database. I used DT3 Info to Change File Names and added Finder Comments using Annotations and Reminders. As I started doing this, I confirmed that the filenames and comments were appearing properly within Mac Finder. The indexed folder had several sub-folders and when I was done with renaming and adding finder comments, I used DT3 to drag and drop the modified files under the single parent folder. I don’t know when the change happened, but now when I look at Mac Finder, there are only comments on about 10% of the files. But the Finder Comments still exist for each file within DT3. I still want those comments to be in Finder. Please Advise

This might have been caused by a random scripting issue of Sonoma that affects all kinds of features intermittently, e.g. sending emails, setting Finder comments, importing emails, clipping websites etc. Usually a restart of DEVONthink and/or the computer fixes this. Updating to 14.2 might also improve things.

Afterwards you could use a script like this one to update the Finder comments of the selected items. But I would suggest to test this first.

tell application id "DNtp"
	repeat with theRecord in selected records
		set theComment to comment of theRecord
		if theComment is not "" then
			-- Force update
			set comment of theRecord to ""
			set comment of theRecord to theComment
		end if
	end repeat
end tell

image

This reminds me of the MVVM model from Microsoft and C# (WPF, Store Apps and Windows Phone). Any change in the data must have the same set to null in this case and then into the collection, to make aware the View of the changes in the Model, instead of resolving the IObservable, IValueChanged, etc bugs. Luckly, no flash in image is seen when doing this. I got no answer when I asked the development team (when I was Microsoft C++ MVP) why they make the entire MVVM model and then ignore most of it and most interesting part, that is left the internals to auto-update all the viewing.

IMHO, and I know this is completely off-topic, we are under a serious software crisis generated by the run to nowhere dictated by marketing un-brained staff, both in Microsoft and Apple, but more in this last one.

I’m sure that once Apple has finished writing their own AI tool, they’ll make it fix all the bugs in their software. Probably even inventing bugs just to fix them.

2 Likes

Thank you for your suggestions. I closed and re-opened the database, I shut down the system and restarted, I updated the MacOS to 14.2. None had any effect.

I’d like to try your script suggestion, but I have no experience with scripts. First of all, are you suggesting this script be added to DT3 scripts and then run when I’ve highlighted the files in DT3?
And secondly, could you confirm the actions for the script? My understanding is that the script would check the Mac OS Finder Comment field. If it is not blank, do nothing, and move on to the next selected record. If it is blank, populate it with DT3 Finder Comment for that record. Then repeat for the next selected record. Is that what this script is intended to do?

Thank you.

Yes

  1. Open /Applications/Utilities/Script Editor.app.
  2. Paste the desired code.
  3. Select Script > Compile to ensure it’s compiling properly.
  4. Select File > Save.
  5. In the Save dialog, press Command-Shift-G and paste ~/Library/Application Scripts/com.devon-technologies.think3/Menu. You can save into that directory or a subfolder of your choice.
  6. Give the script your desired name and save it. The script should now be available in the Scripts menu in DEVONthink.

Thanks for your usual clear instructions. It worked very well for getting the script into DT3. I tested starting with single file, then 3, then one of those 3 to see behavior when the Comments field was populated. It worked great. Did the next 10 in my group, all fine. Then I selected 23 files and the comments only transferred on part of them. See Attachment

Then I noticed some very strange behavior. If I left the mouse cursor hover over one of blank Mac Finder Comment field and the grey content bubble appeared with all of the comment text from DT3 - it just doesn’t show in the Comment field in finder. I’m attaching a screen shot of that appearance.

I thought it might have something to do with the length of the text in DT Finder comments, but there were much longer texts that transferred just fine.

I’m going to try to shut down and restart my Mac to see if the behavior persists. Any other ideas?

What does mdls <filename> in the terminal tell you about one of the files where you’re seeing this behavior?

I tried the shutdown and restart of my Mac to see if it would sort out the strange behavior of some comments not showing in Mac Finder, but the grey text bubble showing on mouse hover. Result - All the Mac Finder Comments in the indexed files are now blank, hovering over the blank comment field doesn’t bring up any text bubble, but the DT3 finder comments are still in place. It seems that the intended change to the Comments field didn’t register with the Mac OS file. Screen shot of the Mac Finder screen after shutdown/reboot is attached
![Screenshot 2023-12-13 at 10.23.50 AM|690x289]
(upload://4m96wadFHtlJN1H5346dukv2zRb.png)

I suppose I could try doing copy and paste of the DT3 Finder Comments to Mac Finder File Info but that’s a slow tedious process and if I’m looking at an OS issue, who’s to say that content will stay in place. Very frustrated. Need some encouragement and ideas.

Trying to get the screenshot of blank comments to load

Does executing the script via the Script Editor.app instead of via the Scripts menu make a difference?

I’m going to hold off on this as none of the files retained the Comments when I shut down and rebooted my mac

DEVONthink sends actually AppleEvents to the Finder to set the comment without waiting for the reply usually. Before Sonoma this was never an issue but now this makes me wonder whether a delay of e.g. one second inside the script’s loop would fix this.

If you’re referring to my suggestion to use mdls – why? That would at least let you know if you’re dealing with a Finder display issue or something deeper.

I’ve never tried this before. Would I select the files in DT3 and then just run the file in script editor?

Yes, I was referring to the mdls querry. Sorry for the confusion. As it stands right now, none of the files are showing any comments so I don’t have a “good vs. bad” comparison opportunity

Exactly.

If none of them show the comments in Finder, then just run the command on one of them. If it spits out an kMDItemFinderComment entry, the comment is there (and Finder just doesn’t display it). Otherwise, it’s not even there.

And there I was thinking, “WTF?” And then I started to search and learn – there really is no official API to set Spotlight attributes. Apart from setxattr which is underdocumented. What a shame.