Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
You might not care, but the script does. Commas are not allowed in the file-name when using the saveAs method.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now