Copy data base structure

You could use this script:


tell application id "com.devon-technologies.thinkpro2"
	try
		set theNum to my duplicateGroups(the selection, incoming group of current database, " copy")
		if theNum is 0 then error "Please select one or more groups."
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
	end try
end tell

on duplicateGroups(theRecords, theDestination, theSuffix)
	local theRecord, theName, theCopy, theNum
	set theNum to 0
	tell application id "com.devon-technologies.thinkpro2"
		repeat with theRecord in theRecords
			if type of theRecord is group then
				set theName to name of theRecord
				if theSuffix is not "" then set theName to theName & theSuffix
				set theCopy to create record with {name:theName, type:group} in theDestination
				set theNum to theNum + (my duplicateGroups(children of theRecord, theCopy, "")) + 1
			end if
		end repeat
	end tell
	return theNum
end duplicateGroups

Just select one or more groups, the copied hierarchy will be stored in the inbox. Afterwards move it to the desired destination, e.g. a new/other database.