Posts

Showing posts with the label regexp

Please wait a bit for Apps Script, then wait a bit more

An unescaped stray plus in a regexp caused all scripts in my project to fail to trigger, not just the ones within the error's reachability tree. I was presented with the following notification when trying to start one manually: We're sorry, a server error occurred. Please wait a bit and try again. I usually discover such complex interactions earlier, but in this case I was tired and I wasn't in a hurry, so I blindly chose to wait until the "server error" gets resolved. I've only STFW after getting back to see if the issue has resolved by itself. StackOverflow: Google Apps Script: We're sorry, a server error occurred. Please wait a bit and try again Specifically, the code contained: string.replace(/+.*$/, '') instead of string.replace(/\+.*$/, '') The editor doesn't let you even save the file if it contains any other kind of syntax error, but this behavior seems to be some kind of a bug.

Google Apps Script for SMS notifications and more

I've recently learned that the Google platform enables you to connect various services via server side ECMAScript . I've encountered a nice example which sends out a notification for each e-mail that your filters tag as urgent. I've altered a lot of its functionalities, and now it supports the following: Concatenates the subject and the body Jams the first 60 characters in the title, the next 63 characters in the location Preprocess automated mails to only keep the most important fields (RegExp does wonders) Extract and aggregate various daily indices of interest (UrlFetchApp is also nice) As an exception to my usual philosophy, I will have to give second thought if I should be sharing these enhancements or not this time.