"move record" issue

I am trying to perform in applescript the equivalent of “Data > group items” in the menu.

on run
	tell application id "DNtp"
		set theRecords to selected records
		set firstRecord to first item of theRecords
		set theGroup to create record with {name:(get name of firstRecord), type:group} in current group
		move record theRecords in theGroup
	end tell
end run

I get an error : “DEVONthink 3 got an error: Can’t make theRecords of parent id 1390527 of database id 5 into type reference.”

To me it seems that the move command is identified as move from the Std Suite and not move from the DT suite. I can’t find a way to specify which move command I want to use.

Any idea? thx.

Replace variable theRecords in this line …

… with firstRecord. And replace in theGroup with to theGroup.

The move command can only be used with a single record, i.e. one can’t move a list in one go.

Oh thank you @pete31! that was it : in => to.

A detail:

Actually yes you can, as the applescript dictionary says.

1 Like

Whoop whoop! How cool is that?! That must have been added in one of the latest releases (or I never managed to use this command with a list). Thank you! :smile:

Since Version 3.0 :slight_smile:

2 Likes