InDesign AppleScript: “modified” Returns False but Document Still Shows Unsaved (*) — Reliable Save Detection?

Does anyone know of a reliable way to determine whether an InDesign document is truly saved?

For example, I would expect the following AppleScript to work:

tell application id "com.adobe.InDesign"
try
set isModified to modified of theDoc
on error
set isModified to true
end try
end tell

However, I’ve run into cases where modified returns false (indicating the document is saved), but the asterisk (*) still appears in the document’s title bar next to the filename—suggesting there are unsaved changes.

This makes it difficult to confidently detect a “safe to proceed” state in automation workflows.

Has anyone found a more dependable method to confirm that a document is fully saved (and not just reporting modified = false prematurely)?