Automatically deleting, labeling files?

I don’t know Applescript, but was wondering if there is some way to:

  1. Have DT automatically label all documents that meet the conditions specified by a particular smart group?
  2. Have DT regularly delete all documents within a specified folder that are older than, say, a week or so- Ideally, this would be implemented by a script that could be attached by a folder.

Just save this script and attach it to a smart group via the Info panel. Opening the smart group in its own window or selecting it in split/3-pane/column views will execute the script.


on triggered(theRecord)
	tell application "DEVONthink Pro" to set label of children of theRecord to 1
end triggered

This script moves all children not modified within the last week to the trash. Attach it also via the Info panel.


on triggered(theRecord)
	tell application "DEVONthink Pro"
		set theRecords to children of theRecord
		repeat with theRecord in theRecords
			set theDate to modification date of theRecord
			set theInterval to theDate - (current date)
			if theInterval < -(3600 * 24 * 7) then move record theRecord to trash group of database of theRecord
		end repeat
	end tell
end triggered

I really like this concept.
Will it work on teenagers?

Mark

1 Like

great thanks so much!