
Need script to count commas in an Acrobat text string.
- or -
Post a project like this1440
$20
- Posted:
- Proposals: 3
- Remote
- #3341015
- Awarded
Description
Experience Level: Entry
This needs to be a custom keystroke script because I need it to trigger when a comma is entered for the third time.
RegEx101.com regular expressions don't always work in Acrobat.
So... for example, I need it to trigger when something like this is entered:
3734,DR3883, PJ373,
On that third comma, I need it to trigger.
This is as far as I got (it doesn't work, LOL)-
var b=/(,[^,]*){3}/
if (event.change != "") {
if (b.test(event.change) == true) {
var count = b.value;
if(count > 2) {
app.alert("test");
}
RegEx101.com regular expressions don't always work in Acrobat.
So... for example, I need it to trigger when something like this is entered:
3734,DR3883, PJ373,
On that third comma, I need it to trigger.
This is as far as I got (it doesn't work, LOL)-
var b=/(,[^,]*){3}/
if (event.change != "") {
if (b.test(event.change) == true) {
var count = b.value;
if(count > 2) {
app.alert("test");
}

Mike G.
100% (24)Projects Completed
17
Freelancers worked with
17
Projects awarded
74%
Last project
16 May 2025
United States
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies