simple script to duplicate record in current group

I’m trying to write a simple applescript to duplicate a record to the current group (to avoid having to select the current group with the mouse). I’m new to applescript, and the script below keeps saying “missing value.” Does anyone know what is missing?

tell application "DEVONthink Pro Office"
	
	set theSelection to the selection
	if (count of theSelection) < 1 then error "Please select one or more items."
	
	set theCurrentGroup to current group
	
	duplicate record theSelection to theCurrentGroup
	
end tell

Did you know that command-d will duplicate the current selection (either a document, or a group)?

Anyway, if a script is needed, this will do


tell application id "DNtp"
	duplicate record content record to the current group
end tell

“content record” is “The record of the visible document in the frontmost think window.”. It is not necessary to declare the database, or the group, if you are working with a single record in a single group.

If you wanted to duplicate the record someplace else (including creating a new group for the destination) then you could use


duplicate record content record to display group selector

Thanks! command-d doesn’t actually do anything on my version. It just beeps (even when a record is selected). I’m using DT 2.7.3 on OSX 10.9.1.

However, I’m sure the applescript will do. Thanks - I appreciate it.

Command-d does create a duplicate here, running DEVONthink Pro Office 2.7.3 under OS X 10.9.2.

Try a restart of your computer, which may exorcise any gremlins that have crept in.