Skip to main content
Known Participant
July 4, 2017
Question

How can make so commas not ok in folder name but okay in file name?

  • July 4, 2017
  • 1 reply
  • 533 views

Hi,

So someone was kind enough to provide the following code to generate an error message if there is a comma in the folder path.  However, this error is also coming up when there is a comma in the file name.  How can I make this error exclusive to only objecting a comma in the folder name and not the filename.  I don't care if there is a comma in the filename.  For example:

C:\\test,in,the,program\file,1.pdf should generate an error

C:\\testintheprogram\file,1.pdf should not generate an error

if (/,/.test(this.path))

{app.alert("Error 104: Action Wizard will not run with commas present in the path folder.  Please remove all commas from the path foler and re-execute the program.");

event.rc = false;

}

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
July 4, 2017

You might not care, but the script does. Commas are not allowed in the file-name when using the saveAs method.