Empty moved to last selected (script help needed)

Hi,

I want to have a script that works likes this:

I select one empty and then one more.
When the script is run the first selected empty moves to the second one.

//W

Hi

I found it out myself.

import bpy
import bmesh
from mathutils import Vector, Matrix
bpy.ops.view3d.snap_cursor_to_active()
bpy.ops.view3d.snap_selected_to_cursor(use_offset=False)

Select first then second and run above.

//W