I created a folder level function for saving a file by passing it a name and a path. The problem is I don't want to allow the user to overwrite a file of the same name. I would rather want to append a version number to it's name so I can keep track of the evolution of the form.
I'm thinking about a script to scan the folder for the occurrence of a file and returns something or throws an error. I experimented with app.browseForDoc() but I don't want the dialog box to show.
I would use a do/while loop to appends a version number and then look for the file until I get a specific return value or error indicating that the file is not present (or in my case that the name is not already used).