I love this script but found it doesn't get the right count when there are more than 1k due to commas.
I modified the below line in checkOpen() //var current_count = parseInt(heading.text().replace(/\n/g, '').replace(/^\s+/, '').replace(/.*\d+ - \d+ of /, '').replace(/(\d+)(.+)/, '$1')); to: var rawString = heading.text().replace(/\n/g, '').replace(/^\s+/, '').replace(/.*\d+ - \d+ of /, '').replace(/(,\d+)(.+)/, '$1').replace(/(,+)/, ''); var current_count = parseInt(rawString)
To basically allow commas in the digit finding, then remove all the commas before parsing int. Hope this helps someone else
I love this script but found it doesn't get the right count when there are more than 1k due to commas.
I modified the below line in checkOpen()
//var current_count = parseInt(heading.text().replace(/\n/g, '').replace(/^\s+/, '').replace(/.*\d+ - \d+ of /, '').replace(/(\d+)(.+)/, '$1'));
to:
var rawString = heading.text().replace(/\n/g, '').replace(/^\s+/, '').replace(/.*\d+ - \d+ of /, '').replace(/(,\d+)(.+)/, '$1').replace(/(,+)/, '');
var current_count = parseInt(rawString)
To basically allow commas in the digit finding, then remove all the commas before parsing int. Hope this helps someone else