Page 1 of 1

Information about onInsert and related scripts

Posted: Thu Feb 18, 2010 11:37 am
by xeon
Hi @all, I got a question about onInsert script and that like.

Basically, in the documentation it is written that:
When Is It Called?
After the item is moved into (or created in) a container, by user dragging, script function, or the core.
Where Does It Live?
The 'program' in a .src file, in a package or /scripts/control
What I would like to know is: which canInsert/onInsert script is called?
All?
The one in which is defined the item which is being moved?
The one in which is defined the container to which the item is being moved?

This to make definitively clarity about this type of scripts. Searching the documentation or the forum didn't answer me.

Many thanks!

Re: Information about onInsert and related scripts

Posted: Fri Feb 19, 2010 4:53 am
by Yukiko
The container into which the item is being created/dragged. There might be a reference where the container is defined in the itemdesc.cfg file if that container requires a custom imsert script.. If there is no special OnInsert script defined under the container then it defaults to the one in /scripts/control I believe. The location of the default OnInsert script might have changed in the cores later than 0.96. I mention this because I saw your post in the 0.96 core section so I assume you're using that core.

Re: Information about onInsert and related scripts

Posted: Fri Feb 19, 2010 7:23 am
by xeon
Yes, I'm on 096. I've seen, re-reading the doc, which a container can have the canInsert/onInsert script manually specified. I didn't recall that.

Question answered, thanks Yukiko!