In ArcGIS Pro 3.3.1, I have a bunch of layouts that each contain a text box with dynamic text showing the last export date. When I export the layouts individually using Share > Export Layout, this dynamic text updates to today's date (as expected).
However, I want to export multiple layouts at once, to save me having to go through each one and manually export them. The following script works (as in it exports all my layouts at once) but it does not update the dynamic text.
import arcpy,os
aprx = arcpy.mp.ArcGISProject("CURRENT")
for lyt in aprx.listLayouts():
lyt.exportToPDF(os.path.join(r"<INSERT FOLDER PATH>", f"{lyt.name}"), clip_to_elements=False)
Is there something I can add to the script to make it update the dynamic text, or is this a bug and should be updating it? I would've thought exportToPDF is what the Share > Export Layout also uses and would therefore work in the same way. I've also tried it with exportToTIFF, exportToJPEG, exportToSVG, and exportToPNG and none of them update the dynamic text either.
I've also looked at the bug fixes for the versions after 3.3.1 and cannot see anything that addresses this issue.