https://support.esri.com/en-us/knowledge-base/how-to-alter-text-elements-in-multiple-mxds-simultaneou-000015333
Is there an updated version of this for Pro? When I use the script with Pro-related updates there are no errors in the tool, but no changes are made. I'm currently debugging and the couple things I'm questioning whether they're actually doing their job are the counter and replace().
import arcpy
import os
arcpy.env.overwriteOutput = True
#workspace folder
arcpy.env.workspace = ws = arcpy.GetParameterAsText(0)
Old_Text = arcpy.GetParameterAsText(1)
oldList = Old_Text.split(', ') #set the comma as separator for multiple inputs
New_Text = arcpy.GetParameterAsText(2)
newList = New_Text.split(', ')
f = arcpy.ListFiles("*.aprx")
for aprxname in f:
aprx_path = os.path.join(ws, aprxname)
aprx = arcpy.mp.ArcGISProject(aprx_path)
for lyt in aprx.listLayouts():
for elm in lyt.listElements('TEXT_ELEMENT'):
counter = 0
for text in oldList:
if text in elm.text:
elm.text.replace(text,newList[counter])
arcpy.AddMessage(f'{aprxname} | updated to: {elm.text}')
counter = counter + 1
else:
counter = counter + 1
aprx.save()

