# Possible to edit component event from script console?

**URL:** <https://forum.inductiveautomation.com/t/possible-to-edit-component-event-from-script-console/20224>\
**Category:** Ignition\
**Created:** [October 17, 2018, 12:11pm UTC](https://forum.inductiveautomation.com/t/possible-to-edit-component-event-from-script-console/20224 "2018-10-17T12:11:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nwells522](https://avatars.discourse-cdn.com/v4/letter/n/b487fb/32.png) [@nwells522](https://forum.inductiveautomation.com/u/nwells522)\
**Post date:** [October 17, 2018, 12:11pm UTC](https://forum.inductiveautomation.com/t/possible-to-edit-component-event-from-script-console/20224/1 "2018-10-17T12:11:02Z")

</div>

I am trying to do a change on a number of component ‘mouseClicked’ event scripts. This involves accessing the text in the script, parsing, and adding in a value. Is this possible?

I have attempted to get the text with the following;’

window = system.gui.getWindow(‘Ovr\_West\_animate1’)  
strTest = window.getRootContainer().getComponent("\_test").mouseClicked

I get a ‘\<CompoundCallable with 0 callables\>’ in the interpreter. Any other ideas on how to do this?

Thanks

---

<div class="post-metadata">

**Author:** ![mrogers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrogers/32/4110_2.png) [@mrogers](https://forum.inductiveautomation.com/u/mrogers)\
**Post date:** [October 17, 2018, 3:13pm UTC](https://forum.inductiveautomation.com/t/possible-to-edit-component-event-from-script-console/20224/2 "2018-10-17T15:13:16Z")

</div>

I think there technically is a way (I’m not sure right now how) to do that, it definitely isn’t supported and you’d probably be better off changing the script to refer to a property, then change that property.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 17, 2018, 6:04pm UTC](https://forum.inductiveautomation.com/t/possible-to-edit-component-event-from-script-console/20224/3 "2018-10-17T18:04:00Z")

</div>

Consider exporting the window in question as XML (via the clipboard, shift-right-click in the nav tree) and editing there. Search the XML for `m="setJythonCode"` to locate the scripts. Then replace the window XML with the edits.

---

<div class="post-metadata">

**Author:** ![nwells522](https://avatars.discourse-cdn.com/v4/letter/n/b487fb/32.png) [@nwells522](https://forum.inductiveautomation.com/u/nwells522)\
**Post date:** [October 17, 2018, 8:56pm UTC](https://forum.inductiveautomation.com/t/possible-to-edit-component-event-from-script-console/20224/4 "2018-10-17T20:56:42Z")

</div>

I ended up changing it via XML, it seemed to work quite well. Thanks for the help.
