I apologize, I’m sure this is an easy fix I’m just awful at scripting. I have a PDF viewer that we use for plant communication. Before upgrade this script would go through a tag that has a list of PDF’s located in our network. I have this on a 10 second timer so when the value hits “0” it just pulls the next PDF network location in the list and changes the PDFviewer file path to that new network location, essentially scrolling through plant announcements every 10 seconds. After upgrade it just simply throws the entire tags value into the PDFviewer file path instead of the next PDF network location. Any help?
if event.propertyName == 'value':
if event.source.value == 0:
pdfList = system.tag.read('Testing/PDFList2').value
if event.source.parent.getComponent('PDF Viewer').filePath == '':
print pdfList[0]
event.source.parent.getComponent('PDF Viewer').filePath = pdfList[0]
else:
try:
index = pdfList.index(event.source.parent.getComponent('PDF Viewer').filePath)
if len(pdfList) < index+1:
event.source.parent.getComponent('PDF Viewer').filePath = pdfList[0]
else:
event.source.parent.getComponent('PDF Viewer').filePath = pdfList[index+1]
except:
event.source.parent.getComponent('PDF Viewer').filePath = pdfList[0]