Force Save Reference Edits?

what’s the way to force save reference edits without getting any popup to interrupt it?
Mel or Python…

I am using saveRefEdits, but it does not have -force tag, is there other way to do it?

saveRefEdits "d:/";


Thank you!

Try ‘file’ command with ‘force’ and ‘saveReference’ flags both set to True:

from maya import cmds

ref_file = r'D:/bjelDark/ref_file.mb'  # path to the referenced file
cmds.file(ref_file, force=True, saveReference=True)

Works great! Thank you @bjelDark