Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Explorer ,
Jul 03, 2017 Jul 03, 2017

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;

}

TOPICS
Acrobat SDK and JavaScript , Windows
443
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2017 Jul 04, 2017
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines