Grouping items by date opened or like a daily journal

Yes, but unfortunately not easily. The only way I can think of is to tag the entries. But one can’t create a global Smart Group via AppleScript which means you’ll have to create it manually.

-- Assign tag to selected History Record's entries

property copyTag : true -- Copy tag (i.e. name of the History Record) for easier creation of global Smart Group

tell application id "DNtp"
	try
		set theRecords to selected records
		if theRecords = {} then error "Please select a History Record"
		set theRecord to item 1 of theRecords
		
		set theRecord_Source to source of theRecord
		set theReferenceURLs to get links of theRecord_Source
		set theRecord_NameWithoutExtension to name without extension of theRecord
		
		repeat with thisReferenceURL in theReferenceURLs
			set thisReferenceURL to thisReferenceURL as string
			set thisLinkedRecord to (get record with uuid thisReferenceURL)
			if thisLinkedRecord ≠ missing value then
				set tags of thisLinkedRecord to (tags of thisLinkedRecord) & {theRecord_NameWithoutExtension}
			end if
		end repeat
		
		-- It's not possible to create a global Smart Group via AppleScript so this needs to be done manually
		
		display dialog "Please create a global Smart Goup with query:" & linefeed & linefeed & "tags:" & theRecord_NameWithoutExtension
		if copyTag then set the clipboard to theRecord_NameWithoutExtension
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
		return
	end try
end tell

1 Like