Live data from Hacker News

How to automate Google related tasks

developers.google.com

11–20 of 28 posts

Re: How to automate Google related tasks

#11
I use Google Apps Script to archive old, unread emails in a label periodically: https://gist.github.com/saagarjha/d8657a5cee921856186cd12180.... I find this handy to clear out a couple of labels that invariably accumulate a junk; for example, I use this on all my mailing list subscriptions. One thing that's really annoying is that Google Apps Script is really eager to delete log entries for some reason, so the logging message I put for checking progress (when time runs out) doesn't ever show up in the logs because it's always likely that the logs were cleared out before I could read them.

Just for fun, I also have an script to post XKCD to a Slack channel: https://gist.github.com/saagarjha/ea067aff9674e8382c15d3b7de.... It's probably not the intended use, but it's free and runs periodically!

Re: How to automate Google related tasks

#12

Earlier quoted context omitted.

Google Apps Script has been around since 2009...

... and has had security incidents http://www.behind-the-enemy-lines.com/2012/04/google-attack-...

TLDR: someone linked to all the images of an S3 bucket from google sheets, and Google proxies loading the images through Google (smart security process). The worst thing here may be that google ignored the Cache-Control returned by S3.

Where is the actual security incident?

Re: How to automate Google related tasks

#13

Good is slowly becoming Microsoft. Just when we finally have a handle on worms spread through Word and Excel Macros, now we will have Google Doc Macros.It will be interesting to see what kind of security vs usability we will see. Also, with these Google macros, will an abusive macro that spams, get you locked out of your Google account and unable to access your documents?

[deleted]

Re: How to automate Google related tasks

#14

Good is slowly becoming Microsoft. Just when we finally have a handle on worms spread through Word and Excel Macros, now we will have Google Doc Macros.It will be interesting to see what kind of security vs usability we will see. Also, with these Google macros, will an abusive macro that spams, get you locked out of your Google account and unable to access your documents?

While you can do what look a lot like (and are called) document macros with this, it's more like a JS PaaS with libraries for Google services than it is like classic MS Office facilities.

Re: How to automate Google related tasks

#15
Google Sheets + Apps Script + UrlFetchApp[1] is a very powerful API runner enabling you to loop through a set of Google Sheet rows to make API calls.

The unofficial APIs exposed by single-page-apps are pretty easy to reverse engineer, too.

1: https://developers.google.com/apps-script/reference/url-fetc...

Re: How to automate Google related tasks

#16
I used Google apps script to make a full invoicing automation system with Zoho CRM, Zoho Invoice, Google Drive, Google's Spreadsheet-to-PDF tool, and Google Cloud Print.

There were a bunch of gotchas in terms of the 6-minute runtime, the available runtime per day, and the script just getting killed randomly.

I managed to work around them all after a lot of hair-pulling... We ran ~15k invoices through it last year!

Re: How to automate Google related tasks

#18
Apps Script is honestly pretty terrible simply because the "IDE" you're working in is terrible. There is no integration with any proper IDE or text editor. It's using ES5 iirc when it could easily support more advanced Javascript versions or when it could allow you to use Typescript. I only sometimes use it out of necessity, but it remains a huge pain.

Re: How to automate Google related tasks

#19
post #16

I used Google apps script to make a full invoicing automation system with Zoho CRM, Zoho Invoice, Google Drive, Google's Spreadsheet-to-PDF tool, and Google Cloud Print. There were a bunch of gotchas in terms of the 6-minute runtime, the available runtime per day, and the script just getting killed randomly. I managed to work around them all after a lot of hair-pulling... We ran ~15k invoices through it last year!

impressive! Good job. But this hair pulling wants me to say "It's the VBA of Google"

Re: How to automate Google related tasks

#20

Recently had to use Apps script to count the number of files in a number of Google drives folder, it was pretty annoying. The Drive API doesn't actually expose that information at all so I had to loop through the files with a counter to get the information I needed, but that was so inefficient that I got timeout errors for anything but the smallest of folders. Unfortunately I had to resort to their Python API which w…

Having used the Spreadsheets API, I can say it's definitely bad, mainly because of its slowness and the small amount of data any query can return. We needed 45 seconds to modify two fields in any given document.
Post reply on HN