Browse tags printing folder

from com.inductiveautomation.ignition.common import TypeUtilities

# Grabs current Date and Time
getDateTime = system.date.now()
# Returns current hour in a 0-23 format
getHour = system.date.getHour24(getDateTime)
# Creates list to store tag paths
paths = []

# Checks if time is Midnight
if getHour == 7:
	# Gets all tags in folder sub structure and writes to an array
    tags = system.tag.browseTags(parentPath="folder", recursive = True)
    for tag in tags:
        if not tag.isFolder():
        	paths.append((tag.path, TypeUtilities.getInitValueForClass(tag.dataType.javaType)))
        	
    paths, values = list(zip(*paths))
    system.tag.writeAll(paths, values)
3 Likes