Question
[JS] File Naming Issues
NOTE: I am writing JavaScript for InDesign CS2 and CS3.
My script involves writing file names that a user will input. The filenames will later be displayed in a menu. Since characters like ? % " / : can present problems, what's the best way to avoid bad file names? Should I just search the string for the characters I stated above before writing the filename? Or is there a better way to avoid bad characters?
If the best way is to scan for bad characters, what are all the characters I should prevent users from inputting? I thought of the following:
? % " / :
Are there any I missed?
Thanks in advance,
Dan
My script involves writing file names that a user will input. The filenames will later be displayed in a menu. Since characters like ? % " / : can present problems, what's the best way to avoid bad file names? Should I just search the string for the characters I stated above before writing the filename? Or is there a better way to avoid bad characters?
If the best way is to scan for bad characters, what are all the characters I should prevent users from inputting? I thought of the following:
? % " / :
Are there any I missed?
Thanks in advance,
Dan