Access Components jythonCode in Script

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.


IIRC, user-defined event methods and custom methods are all stored as “client properties” of each component. See getClientProperty() 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?

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.