I have looked at the following posting
And it seemed close to what i want to do. However I keep getting an attributes error.
What I am trying to do is within a Global script poll the a data set from a page if the page is open. SO far I have the if page is open part working, what I can seem to get is the final part where it will poll the data from that page. Here is what I have so far:
window = fpmi.gui.getWindow(‘Test Window’)
from fpmi.gui import getWindow
window1 = getWindow(“Test Window”)
data = fpmi.db.toPyDataSet(window1.Container.getComponent('Job Tasks').getComponent('notes').data)
data1 = fpmi.db.toPyDataSet(window.rootContainer.Container.getComponent(‘Job Tasks’).getComponent(‘Table’).data)
fpmi.gui.warningBox(“The Turnover window isn’t open”)[/code]
and here is the error message that I get when I try to run this script
Traceback (innermost last):
File “<KeyBinding:FPMI KeystrokeAction:pressed F1>”, line 6, in ?
AttributeError: instance of ‘com.inductiveautomation.factorypmi.application.FPMIWindow’ has no attribute ‘Container’
at org.python.core.Py.AttributeError(Py.java) at org.python.core.PyObject.__getattr__(PyObject.java) at org.python.pycode._pyx149.f$0(<KeyBinding:FPMI KeystrokeAction:pressed F1>:6) at org.python.pycode._pyx149.call_function(<KeyBinding:FPMI KeystrokeAction:pressed F1>) at org.python.core.PyTableCode.call(PyTableCode.java)
Thank you for taking the time to look at this and have a Merry Christmas and a Happy New Year.