Change Created date?

I keep a Created column to show dates when documents were created, but every once in a while I wish I could change a date. I don’t want to switch to a Date Modified column, so is there some way I can edit a created by date?

There’s a script that will let you do that, at devon-technologies.com/suppo … ripts.html

I have the same issue but I noticed the link provided is no longer active. Could anyone help me changing the ‘created date’ date?

A number of “extras” are now available from Help > Support Assistant - Install Extras. Under the Scripts category, install the Change Date script.

This script allows you to change the date modifed, not the date created. I know nothing about applescripts, so I need one pre-created. Is there a script to change the date created? If so, I’m not able to find it. Would also be helpful to be able to change the date added.

This script will prompt you for this type of date: “Created”, “Modified” or “Both” – it will then prompt you for the new date. The script will operate on a contiguous or dis-contiguous selection of documents, and will make the same date modification to every document in the selection. (I.e., use with care. Once a date is changed, there is no way to know what the former date was – EDIT: a switch can be set in the script now that will record the old and new dates into the DEVONthink log.)

-- set creation date, modification date, or both 
-- v1 20120925 original
-- v2 20130215 prompt for type of change
-- v2.1 20130216 add option to log results (DEVONthink > Window > Log)
-- based on DEVONthink > Scripts > Date > Set Date.scpt
-- whose original was created by Christian Grunenberg on Sun Mar 12 2006.

property logSwitch : false

try
	tell application id "com.devon-technologies.thinkpro2"
		set this_selection to the selection
		if this_selection is {} then error "Please select some contents."
		
		set dateType to (choose from list {"Created", "Modified", "Both"} with title "Change a date" with prompt "Which date do you want to change?" default items {"Created"}) as string
		
		if dateType = "Created" then
			set datePrompt to "Enter creation date "
		else if dateType = "Modified" then
			set datePrompt to "Enter modification date "
		else
			set datePrompt to "Enter date for both creation/modification "
		end if
		
		set theDate to (date of item 1 of this_selection)
		set theMonth to ((month in theDate) as integer) as string
		set theDay to the day in theDate as string
		set theYear to the year in theDate as string
		
		set oldDate to theDate
		
		if (theDate as string) contains "." then
			set defaultDate to theDay & "." & theMonth & "." & theYear as string
			display dialog datePrompt & "in DD.MM.YYYY format:" default answer defaultDate buttons {"Cancel", "OK"} default button 2
		else
			set defaultDate to theMonth & "/" & theDay & "/" & theYear as string
			display dialog datePrompt & "in MM/DD/YYYY format:" default answer defaultDate buttons {"Cancel", "OK"} default button 2
		end if
	end tell
	
	set theDate to date (the text returned of the result)
	
	tell application "DEVONthink Pro"
		repeat with this_record in this_selection
			if dateType is "Created" then
				set creation date of this_record to theDate
			else if dateType is "Modified" then
				set modification date of this_record to theDate
			else if dateType is "Both" then
				set date of this_record to theDate
			end if
			
			if logSwitch then -- BEGIN optionally log results
				set date_change to " From: " & (oldDate as string) & " To: " & (theDate as string)
				set log_message to (((name of database of this_record) & (location of this_record) & (name of this_record)) as string)
				log message log_message info ("Changed \"" & dateType & "\"" & date_change)
			end if -- END optionally log results
			
		end repeat
	end tell
	
on error error_message number error_number
	if the error_number is not -128 then 
		try
			display alert "DEVONthink Pro" message error_message as warning
		on error number error_number
			if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
		end try
	end if
end try

[size=80]

20130216 Added a property switch to optionally log the changes (see DEVONthink > Window > Log).[/size]

1 Like

In an earlier post in this thread I provided a link to a script that will change dates. That link is no longer valid.

A number of “extras” are now available via the DEVONthink application’s Help menu. In the menubar, choose Help > Support Assistant, then click on the “Install Extras” link (scripts are available for DEVONthink Pro and Pro Office, including the Change Date script).

This is great! The script posted worked! Should be noted that the script available from the extra installs only allows the date modified to be changed and does not allow a choice.