# generateScript method called twice for the same ProgramNodeContribution

**URL:** <https://forum.universal-robots.com/t/generatescript-method-called-twice-for-the-same-programnodecontribution/1582>\
**Category:** URCap Development\
**Tags:** generate-script\
**Created:** [February 5, 2018, 2:27pm UTC](https://forum.universal-robots.com/t/generatescript-method-called-twice-for-the-same-programnodecontribution/1582 "2018-02-05T14:27:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [February 5, 2018, 3:01pm UTC](https://forum.universal-robots.com/t/generatescript-method-called-twice-for-the-same-programnodecontribution/1582/2 "2018-02-05T15:01:07Z")

</div>

In general, the code should be able to handle multiple calls to the `generateScript` method.  
It can be called when program is saved, or typically when the program is played.  
At play instance, it could happen, if the user double-taps (debounce) on the Play button.

Note: generateScript is only called, when all nodes in a program context return true on their respective `isDefined` calls.

---

_[View the full topic](https://forum.universal-robots.com/t/generatescript-method-called-twice-for-the-same-programnodecontribution/1582)._
