Home/ Reference/ View & Performance

doc.Dirty

Whether the file has unsaved changes. This is what decides whether you save, and whether to prompt.

Signature

doc.Dirty

Notes

Whether the file has unsaved changes. This is what decides whether you save, and whether to prompt.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
print("Unsaved changes: ", doc.Dirty)

if doc.Dirty:
    doc.Save()                                      # only save when something changed
    print("Saved")
else:
    print("Nothing changed, skipping the save")

About this section: View & Performance

View & Performance — display and performance switches.

Other entries in this section