Ignition Perspective Ad Carousel

import os

def imagePath(imageNameList, folderPath):
	imageViewList = []
	for x in range(len(imageNameList)):
		imageViewList.append(
		{
			"viewPath": "AdView",
			"viewParams": {
				"imagePath": "/Ads/"
			},
			"direction": "row",
			"justify": "flex-start",
			"alignItems": "flex-start"
		})
		imageViewList[x]['viewParams']['imagePath'] = folderPath + imageNameList[x]
	return imageViewList
	

folderPath = "C:/Program Files/Inductive Automation/Ignition/webserver/webapps/main\Ads"
localFolderPath = "/Ads/"
imageNameList = os.listdir(folderPath)
data = imagePath(imageNameList,localFolderPath)
system.tag.writeBlocking(["[default]Ad Data"], [data])

This is the script I ended up using. I am storing the ads images in the Webserver Webapp folder, using this trick and I write the new Ad Data to a document tag called "Ad Data" and bind that value to the data component of the carousel.

The Webserver Webapp trick has interesting issues. I can drag in new ads just fine, but I can not delete them as the windows operating system marks them as in use by the java process. I get around this by a bat script starting and stopping the ignition process. The operators of this station will just need to stop the ignition process before they update the ads and restart it.

Start bat script:
net start "Ignition"

Stop bat script:
net stop "Ignition"

Because I am using a Carousel, I can change "lazyLoading" set to False. This seems to bypass this issue.