# Problem after upgrade with scripting a pdf viewer

**URL:** <https://forum.inductiveautomation.com/t/problem-after-upgrade-with-scripting-a-pdf-viewer/24365>\
**Category:** Ignition Early Access\
**Tags:** scripting\
**Created:** [April 24, 2019, 5:37pm UTC](https://forum.inductiveautomation.com/t/problem-after-upgrade-with-scripting-a-pdf-viewer/24365 "2019-04-24T17:37:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dholt](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dholt/32/4458_2.png) [@dholt](https://forum.inductiveautomation.com/u/dholt)\
**Post date:** [April 24, 2019, 5:37pm UTC](https://forum.inductiveautomation.com/t/problem-after-upgrade-with-scripting-a-pdf-viewer/24365/1 "2019-04-24T17:37:58Z")

</div>

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?

```auto
 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]

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 9, 2019, 4:12pm UTC](https://forum.inductiveautomation.com/t/problem-after-upgrade-with-scripting-a-pdf-viewer/24365/2 "2019-05-09T16:12:18Z")

</div>

@dholt  
If you print `pdfList` after this line:  
`pdfList = system.tag.read('Testing/PDFList2').value`  
What’s the value of it?  
I wonder if something’s getting inadvertently turned into a string, so your array manipulation becomes string manipulation.

---

<div class="post-metadata">

**Author:** ![dholt](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dholt/32/4458_2.png) [@dholt](https://forum.inductiveautomation.com/u/dholt)\
**Post date:** [May 20, 2019, 12:42pm UTC](https://forum.inductiveautomation.com/t/problem-after-upgrade-with-scripting-a-pdf-viewer/24365/3 "2019-05-20T12:42:43Z")

</div>

@paul-griffith Thanks for the reply, I actually had someone from inductive contact me over the phone and issue is resolved. Thanks for replying, my apologies for late reply back. Thanks again!
