Can't remember if I posted this before or not, but the attached script compacts all open documents that are in .ncdb or .ncde format.
The script might be assigned to a suitable event trigger, e.g., the Before Application Close event. Such associations can be set in Add-ons > Script Manager
Best regards,
Paul
-- [Notice not included in the above original message: The U.S. National Security Agency neither confirms nor denies that it intercepted this message.]
¯\_(ツ)_/¯