Altering document names from ScanSnap

When ScanSnap sends documents to DT, I have it naming them with the date in this form: YYYYMMDD. It seems that I used to be able to adjust this format in ScanSnap, but the new software seems to have reduced my options.

What I want is for the date to have a space after the year, like YYYY MMDD.

I know DT can do this with a smart rule, but I’m not smart enough to know how to do that. (See what I did there?)

Any help appreciated!

Name condition 20[0-9][0-9][0-9][0-9][0-9][0-9] (not 100 % …) and this script should do it.

-- Change name from "YYYYMMDD" to "YYYY MMDD" 

on performSmartRule(theRecords)
	tell application id "DNtp"
		try
			repeat with theRecord in theRecords
				set theName to name of theRecord
				set newName to (characters 1 thru 4 in theName & space & characters 5 thru -1 in theName) as string
				set name of theRecord to newName
			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
			return
		end try
	end tell
end performSmartRule

Thank you so much! Perfect!

If you are using ScanSnap Home, you can come close to the format you want in the detailed settings dialog once you edit the profile for scanning to DEVONthink.


The Date format pulldown will give you YYYY-MM-DD as a choice.