Items list: Default sort order

By default, the items list is sorted by name. But I rather would like to sort my items by date created. Is there a way to change the default sort order?

(This has been asked many times, but I could not find an answer.)

Right click on one of the columns and you can choose which columns you do or do not want displayed (including date create). Then click on the name of that column and you can choose to sort ascending or descending by that column.

Or choose View/Sort

Thank you very much for the detailed answer.

Does that change the default sort order for all other groups? If not, is that possible to do?

Just for that group

No, there is no default sort order at this time.

just making sure: that option is still missing, right? searching for it myself now. any workarounds? the best i could come up with is using the list view and never open a group but always just expand it. that way one only has to set the sort setting in the root of every database.

1 Like

also need this. I am used to default sort order by date in email programms or other programms.

It’s been a while since this was asked - is there a way to set a default sort order as it is a real pain have to set it on 100s of folders?

You could create a script that runs for specific groups (or all groups) that updates the sort order through GUI scripting. It’s not the best, but if you want to (re)set a sort order every once in a while it works fine. The sortOption has to specificed in the exact way it appears in the menu (including capitalization).

Be aware this resets the sorting for all groups; if you want to exclude certain groups (or e.g. a specific sort that you always want to keep) you have to edit the script. E.g. this script looks at groups from the current database, but excludes ordinary tags.

tell application id "DNtp"
	try
		set theGroups to every parent of current database whose tag type is not ordinary tag
		repeat with theGroup in theGroups
			set root of viewer window 1 to theGroup
			my setSorting("by Kind")
		end repeat
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
	end try
	
end tell

on setSorting(sortOption)
	tell application id "DNtp"
		activate
		tell application "System Events"
			tell process "DEVONthink 3"
				click menu item sortOption of menu 1 of menu item "Sort" of menu "View" of menu bar 1
			end tell
		end tell
	end tell
end setSorting

Unfortunately the “On Open” action for smart rules doesn’t trigger when changing groups in DT afaik, but @BLUEFROG or @cgrunenberg might be able to comment if there are other possibilities to trigger this.

Thank you for this - very helpful.