Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

How to scan a specific folder for the existance of a PDF before saving

$
0
0

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).


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>