I'm working on a script to set to uppercase a selected text in a Google document. The script works ok, but it is extremely slow in a large document. So I stripped down almost everything to perform some speed test and I realised that this simple line:
var document = DocumentApp.getActiveDocument();
already takes 9-10 seconds to perform for a 150 pages document.
Is there a way to speed up the process, i.e. precaching "document" so that when I invoke my script I can use my getCursor() or getSelection() in a reasonable time?
You can't precache this. The services provided for caching are:
So I'm afraid that you will need to cope with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With