yeah @justinedwards.jle , i tried that onein my script. i using the templateHolder and VisionTemplate class in function.

Then, i have seen the name of the window by using the print function. it shows the name the template, but cannot able to read the String values of the component on the template.
the template windows are,
I gives name of the window is Window_Template. And i put the template in another window.That is,

here i given the name of the template is "Window_template". Then, when i run the above script, that time it'll shows the Template name, but didn't given the values.
from com.inductiveautomation.factorypmi.application.components.template import VisionTemplate
from com.inductiveautomation.factorypmi.application.components.template import TemplateHolder
from com.inductiveautomation.factorypmi.application.components import BasicContainer
from java.lang import String
def printTextAndDataStrings(container):
ins_list = []
for component in container.getComponents():
if isinstance(component, BasicContainer):
printTextAndDataStrings(component)
if isinstance(component, TemplateHolder):
print "Yes, this one is a TemplateHolder"
print component.name
printTextAndDataStrings(component)
if isinstance(component, VisionTemplate):
print "Yes, this one is a Template"
print component.name
printTextAndDataStrings(component)
if hasattr(component, 'text'):
val = component.text
ins_list.append(str(val))
if hasattr(component, 'Text'):
val = component.Text
ins_list.append(str(val))
if hasattr(component, 'data'):
dataset = component.data
if dataset.rowCount > 0 and dataset.columnCount >0:
for column in range(dataset.columnCount):
value = dataset.getValueAt(0, column)
if isinstance(value,(String, unicode)):
val = dataset.getColumnAsList(column)
for x in val:
ins_list.append(str(x))
if hasattr(component, 'Data'):
dataset = component.data
if dataset.rowCount > 0 and dataset.columnCount >0:
for column in range(dataset.columnCount):
value = dataset.getValueAt(0, column)
if isinstance(value,(String, unicode)):
val = dataset.getColumnAsList(column)
for x in val:
ins_list.append(str(x))
query = "SELECT Keyes FROM translation"
val = system.db.runQuery(query,"MySQL")
val1 = val.getColumnAsList(0)
list = []
for x in ins_list:
if x in val1:
pass
else:
list.append(str(x))
y = "('" + "'),('".join(list)+ "')"
# print y
if y != "('')":
query = "insert into translation (Keyes) values {}".format(y)
run = system.db.runPrepUpdate(query,[],"MySQL")
print run
windows = system.gui.getWindowNames()
e_list = []
for path in windows:
e_list.append(path)
for x in e_list:
# system.nav.openWindow(x)
rootContainer = system.gui.getWindow(str(x)).rootContainer
printTextAndDataStrings(rootContainer)
This one is i using for fetching the al string values from windows and Templates.
Thanks,
