Scripts to move file with replicants in one group to another

Dear forum member, just need help for one line of coding (I believe). Perhaps also a reminder of caution when using the stock script “Move___Cmd-Ctrl-M.scpt”.

I am trying to modify the stock scripts “Move___Cmd-Ctrl-M.scpt” because the code used in this script will remove all instances of the selected files from all groups (replicants) and move just one single instance to the destination group. Reference to some other posts (thanks),
I basically just add two lines of modified code:
(1) “set theFrom to the first parent of thisItem”
(2) “set thisItem to move record thisItem from theFrom to theDestination”

However, this still doesn’t work as expected. It is because “first parent” is referring to the group that “first-created” the file’s instance, not the group where the current replicant is located (which could be the nth instances). I tried using just “parent” but I guess the syntax is incorrect because all instances of the files in other groups are still removed but one in the destination group.

Thank you in advance

Move the selected record(s) to a destination
that was selectected from the Group Selector panel

	tell application id "DNtp"
		set theDatabase to current database
		-- set theSelection to selection
		set theSelection to (the selection as list)
		if theSelection is {} then error "Please select something"
		set fromPath to (the location of item 1 of theSelection) & (the name of item 1 of theSelection)
		set fromDatabase to the name of theDatabase
		set theDestination to (display group selector "Select a Destination")
		if theDestination is {} then error "We had a problem choosing the destination"
		set toPath to (the location of theDestination) & (the name of theDestination)
		set toDatabase to the name of the database of theDestination
		repeat with thisItem in theSelection
			set theFrom to the first parent of thisItem
                        -- just code for seeing the name of first parent, not used in actual code
			-- set theParentName to the name of theFrom as string
			-- display alert theParentName
			-- run this line to move just the replicant within this group to the selected group
			set thisItem to move record thisItem from theFrom to theDestination
			-- run this line to move all instances of the records to the selected group
			-- move record thisItem to theDestination
		end repeat
		-- Post the result to the Log
		set movedFrom to "Moved from: " & fromPath & " in " & fromDatabase
		set movedTo to " -- Moved to: " & toPath & " in " & toDatabase
		set theLogEvent to log message (movedFrom & movedTo) info "Mover Script"
	end tell
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

I have sorted out the right code.

When I am selecting one/multiple items(with replicants or not), the group is the “current group”. So all I need is to change the code from “set theFrom to the first parent of thisItem” to “set theFrom to the current group”.
(1) This new code serves my purpose. However, there is a catch. The original move script can move either items or groups, this new code can only move items.
(2) Whether move is activated by menu selection, mouse drag, context-menu, or commands in script, the action doesn’t handle multiple replicants of the same item within the same group. If replicants of the same items already exist in the destination group, moving another replicants of the same items creates multiple and identical items in the group. The default “Duplicates” smart group won’t be able to identify these multiple and identical replicants.

Best regards