Getting slot id when launch
Hello!
I am developing my first max for live device, and I am stuck trying to do that my device recognise which midi slot is launched in the session view. Also I would like that it can tell what's the name of the midi clip launched. The device is placed in the same midi track, so I understand I have to start my patch with live.thisdevice patched with live.path this_device canonical parent, so it can identify the track where the device is sitting on. After that I am very confuse about how to use live.object and live.observer. I understand that with live.observer I can get the info of when the clip is launched? Is that right? I am not sure now what live.object could do :/ After I figure out that, the idea is that I will get the name of the empty midi clip launched and this will go to a node, and this will look for some movie clips files and play them in a jit.world window. That part I have it figure out, but launching and getting the information out of the launched slot is still difficult to understand.
playing slot index tells which slot is playing ( if none, outputs -2)
fired slot index shows which slot is idle to start playing

Thanks for replying. I have some questions about your patch: I understand live.thisdevice is like using loadbang but somehow better for max4live devices? Also, could you use "path" instead of "goto" message? And also the fired slot index refer to the clips that are already launched but waiting for the previously played clip to end? Sorry for all the questions, just want to get it right
That patch gives you what you asked for,
and also opens the path for you to experiment.
I am not live user and can't spend time to learn about all possibilities
simply because I have no interest in it.
By the way I labeled this wrong, it is clip id, and not slot id

to get slot id, remove clip
goto this_device canonical_parent clip_slots $1 clip
If you want to try if path instead of goto works, why not try yourself ?
or read LOM documentation ?
to the fired_slot_index
fired state means something has been told to execute.
whatever it is does not care about other objects but only about itself.
in other words it does not wait for something else to finish but
tries to execute on next occasion.
if live is set to execute quantised then you have idle time from fire
command till it gets executed.
otherwise there is no ide time and also no sense to detect fired state.
one more P.S. (sorry I did not catch the question immediately)
live.thisdevice is different than loadbang.
you can read it's help file to get the differences.