Capturing date information before sending to DT

I have the search sets working very nicely now but have one challenge - in the results in DA, there is a date column that shows the date of article. When I send the results to DT, all of the dates are changed to the current date (created, added, modified). Document date, whatever that might be, is empty. No placeholder seems to have date info beyond those I mentioned.

I have a rule in DT that changes the name of files to NAME + MODIFICATION date. But that won’t be of any help once the DA-sent article arrives in DT. Where would the date info that DA uses to sort the results be found in the metadata?


1 Like

This information is currently not added to DEVONthink. One workaround might be to add search results via a script to DEVONthink.

Thanks, but since I have no real experience in scripting, could someone point me in the right direction. Am I telling DA to add a date field somewhere or am I telling DT to do something to the results before the import which changes the creation date to the current date?

I really need to figure this out as only about 5% of clutter free PDFs even include the date in the text. Seems a strange oversight for the export process.


You could e.g. have a look at the script ~/Library/Application Support/DEVONagent/Action Scripts/File results in DEVONthink. This script can add results in various formats to DEVONthink and can be used in search sets (see Actions tab of Search Sets window). You would have to set the creation/modification date of the created record to the date of the search result.

It’s actually the first request of its kind but noted.

My current setup is working very well. Each search set adds it’s results to DT in the appropriate group without using any script. So if I figured out how to write a simple script “Change creationdate to thedate” or something like that, would that be all I need to do? I wanted to test it but I don’t know where to find the list of placeholders for DA.

You can have a look at the AppleScript support of any app by dropping it onto the Script in the Dock or Finder.

I’m close now to getting what I need. This is the script I am using. At the line that says "set title to theTitle, it works if I ask it to SAY the result (filename & date) but if I try to SET anything from the result I get an error message “Can’t make «class DTda» of application “DEVONagent” into type text.”.
I tried Title, Name, Summary, even URL as places to SET to the new name.

I tried REFORMAT DATE to TEXT but that couldn’t be done either. Is there any way to add the date to the filename as text?

on results(theResults, theSet, theQuery)

tell application "DEVONagent"
		set pathToApp to (path to application id "com.devon-technologies.agent" as string)
		set pathToAdditions to (pathToApp & "Contents:Resources:Script Additions.scpt") as alias
		set helperLibrary to load script pathToAdditions
		if not (exists search window 1) then error "No search window is open."
		set theSearch to search window 1
		if searching of theSearch then error "Search is not yet complete."
		set theResults to search results of theSearch
		repeat with theresult in theResults
			set theTitle to title of theresult
			reformat date as text
			set thedate to date of the result as text
			set theTitle to theTitle & date as string
			set title to theTitle
		end repeat
	on error error_message number error_number
		display alert "DEVONagent" message error_message as warning
	end try
end tell

end results