Know object select order in python
Blender doesn't really have a &quot;select order&quot;
The standard method used by blender operators is to use the context object (context.object, context.active_object) and selected object(s) (context.selected_objects in which if there is a context object, it will occupy position 0).
For example Ctrl+P the parent operator makes the context object the parent of all selected objects, except itself. One parent many children.  Similarly for join all like typed selected objects are joined to the context object.
Henceforth for making an operator to select emitter and particle you need to decide which is the  many, ie make the context object a particle and then make all other selected objects an emitter of that particle, or vice versa.