DEVONthink 4 truncates long file names with more than 256 characters

Over the years, for various reasons, many files and groups have been created in my DEVONthink databases that have more than 256 characters. Even though this is probably a practice that is discouraged anyway, so far there has been no problem with this within DEVONthink. However, DEVONthink 4 now truncates these file names, but only as soon as I edit the file names (within DEVONthink 4).

I am now using DEVONthink 3 again, where this is not the case, i.e. the filenames with more than 256 characters remain in full length, even after editing. Even though it is probably not considered a bug in the true sense of the word, I wish I could continue to use my “too long” file names in DEVONthink 4 without them being forcibly shortened during editing.

I also wanted to warn other users - if there are any other users who use such long file names - who might encounter the same problem and might not even realize it at first.

Actually both versions use the same limitation, version 2 already did. Using version 3.9,9 or version 4.0beta1 therefore shouldn’t make a difference in that regard. Do you remember when and how you created these too long titles?

Thank you for the very quick reply. I was using version 3.9.4 before version 4 (and am now using 3.9.4 again), and there is no such limitation. Many of the files are several years old, but I was able to both create and edit file names with more than 256 characters without truncation in DEVONthink 3.9.4 even at this moment for testing.

In that case this was actually a bug, not a feature. The names should be limited to 256 characters for a long time now. Actually we recommend even shorter names to improve the compatibility to most filesystems. For longer information other metadata, e.g. comments or custom metadata, might be more suitable.

1 Like

Is there a way to find the relevant files using a smart group or a similar approach, so that I can systematically and sensibly shorten them without losing information (as would happen by simply truncating the file name at the end)?

Only via AppleScript, e.g.

tell application id "DNtp"
	set theDatabase to current database
	set theResults to {}
	repeat with theContent in contents of theDatabase
		set theName to name of theContent
		if length of theName ≄ 256 then copy theContent to end of theResults
	end repeat
	set search results of main window 1 to theResults
end tell

The script still gave an error message about ‘main window’:
Syntaxfehler: „Klassenname“ kann nicht diesem „Identifier“ folgen.

But I’m sure I’ll find a solution based on your script, I don’t want to take up too much of your time. Thank you for the great support.

Do you still use version 3? This script is intended for version 4. In case of version 3 replace main window with viewer window

1 Like

Great, that works. - Yes, I am now using version 3 again, I will gradually change the file names there and then test version 4 again later. Thanks again!