I want to show a progress bar while i'm running a loop but it does not update the window till the loop is done

event.source.parent.getComponent(‘Progress Bar’).value = 0
output = ‘’
tags = system.tag.browseTagsSimple("", “ASC”)
tagCount = 0
doubleCount = 0
headers = [“opc”,“name”, “fullname”,“doc”]
data = []
for tag in tags:
event.source.parent.getComponent(‘Progress Bar’).value = event.source.parent.getComponent(‘Progress Bar’).value + 1
if not tag.isFolder():
opcAddress = system.tag.read(tag.fullPath + “.OPCItemPath”)
opcDoc = system.tag.read(tag.fullPath + “.Documentation”)
if len(opcAddress.value) > 5:
data.append([opcAddress.value,tag.name,tag.fullPath,opcDoc.value])

Put three back ticks ` before and after your code to format it and indent it properly.

Either way, you need to have your script run asynchronously from the foreground.

1 Like

That’s what I need

Thank you