The free Javascript “Save file with automatic numbering” for Adobe Illustrator 2022, Adobe Photoshop 2022 and Adobe InDesign 2022 saves the current saved document in the file format .ai, .psd or .indd and automatically adds a consecutive number to the file name. Thus, the file “Example.ai” becomes the file “Example-0001.ai”, “Example-0002.ai” and so on; this works analogously for Photoshop and InDesign. This is also called “incremented” (continuous) saving. In this way, you can save individual steps in between and go back to an older version if necessary. The Javascript also works with older versions of Illustrator, Photoshop and InDesign.
https://www.behance.net/gallery/133799381/Javascript-for-AI-PS-ID-Save-with-automatic-numbering
Merry Christmas to all
– jens.