# Access Components jythonCode in Script

**URL:** <https://forum.inductiveautomation.com/t/access-components-jythoncode-in-script/17166>\
**Category:** Ignition\
**Created:** [February 28, 2018, 12:15pm UTC](https://forum.inductiveautomation.com/t/access-components-jythoncode-in-script/17166 "2018-02-28T12:15:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malcolm](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/malcolm/32/5970_2.png) [@Malcolm](https://forum.inductiveautomation.com/u/Malcolm)\
**Post date:** [February 28, 2018, 12:15pm UTC](https://forum.inductiveautomation.com/t/access-components-jythoncode-in-script/17166/1 "2018-02-28T12:15:33Z")

</div>

Is there a way to access the script behind a component on a windows and retrieve it into say a string.

I am upgrading an older project and have multiple menu screens driven by individual buttons which I am improving to a dynamic menu screen using templates, template repeaters to make it more manageable.

Rather than re-type all the button information into the dataset that drives the new screen I have a script which will iterate through all the existing buttons on a page and retrieve the button text and image references to a dataset, if I could also get the script into a string I could parse it to get the window name called by the original button.

I can see in a pages XML export the code is in there using setJytonCode method, but as I have already the script to scan through the components would like to see if I can get access to the code through Ignition.

thanks

---

<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:** [February 28, 2018, 1:29pm UTC](https://forum.inductiveautomation.com/t/access-components-jythoncode-in-script/17166/2 "2018-02-28T13:29:24Z")

</div>

IIRC, user-defined event methods and custom methods are all stored as “client properties” of each component. See [getClientProperty()](https://docs.oracle.com/javase/8/docs/api/javax/swing/JComponent.html#getClientProperty-java.lang.Object-) in the JComponent javadoc. There’s no publicly exposed method for retrieving all of these properties, and Swing uses them for internal purposes, too. Maybe someone from IA could supply a list of keys? And the pattern for the keys of custom methods?

---

<div class="post-metadata">

**Author:** ![Malcolm](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/malcolm/32/5970_2.png) [@Malcolm](https://forum.inductiveautomation.com/u/Malcolm)\
**Post date:** [February 28, 2018, 3:53pm UTC](https://forum.inductiveautomation.com/t/access-components-jythoncode-in-script/17166/3 "2018-02-28T15:53:48Z")

</div>

Thanks for pointing to that, I have used script to create most of the data and re-typed/cut & pasted the destination windows, didn’t take too long, I think I was just getting lazy.
