Stream

Join this community to post or comment

Dimu Designs

Tips & tricks  - 
 
Up until a few weeks ago I always assumed that only one project(collection of scripts) could be bound to a container ie. a document, spreadsheet or form. Apparently you can bind multiple projects to a single container.

When you first open the script editor from a container, a project is created that will house scripts. It turns out that any projects created from that container-bound project are container-bound projects themselves and all of those new projects are bound to the same container as the project that spawned them.

Whenever a container has multiple projects users will be presented with a list of projects to choose from after opening the script editor (instead of going directly to the script editor for containers with only one project).

I doubt this revelation will be of much impact, but its cool to know.
1
Add a comment...

Alan Wells

Tips & tricks  - 
 
To find a function declaration put the letter "n" and a space in front of the function name.

n myFuncName

When doing a search. If you search the function name, you will get all the places where the function is called. Putting "n " before the function name in a search takes you directly to the function declaration.
6
2
Michael Ellis's profile photo
 
A useful tip, thanks!
Add a comment...
 
Experiencing annoying Exceptions by thread.getMessages()?
Well we did, and we found a work around

Trying to fetch new emails every minute was working fine for many years but recently started to result in hundrets of error messages. Increasing the delay in exponential backoff did not solve the issue this time.

We now change the trigger frequency to every 5 minutes, for the period of one hour, and return to one minute afterwards. The procedure was inspired by a comment of +Bruce Mcpherson on a similar problem.

Remember the total number of triggers is limited, so setting a trigger for switching back may not be possible in every situation. But you could use a user property and compare with a timestamp.

Please let us know if you have had similar problems and how you solved them, because reliable processing of emails as fast as possible is key to our service.

https://developers.google.com/apps-script/reference/gmail/gmail-thread
1
Add a comment...

Bruce Mcpherson
moderator

Tips & tricks  - 
1
Add a comment...

Laura Taylor

Tips & tricks  - 
 
I developed a configurable Jekyll theme for rapid Google Apps Script UI prototyping. Includes Execution API integration for testing.

Github project here:

https://github.com/techstreams/gapps-jekyll-basic

1
Add a comment...

Martin Hawksey
moderator

Tips & tricks  - 
 
 
Missed our last Totally Unscripted episode? Here's a condensed version.

Hope you can join us for our next show on Friday 16th Sept. 7am PDT / 10am EDT / 3pm BST / 4pm CEST / 7.30pm IST on Add-on Monetization and Exponential Backoff http://bit.ly/TotallyUnscripted-3
2
George Lawrence's profile photo
 
OK I will
Add a comment...

Bruce Mcpherson
moderator

Tips & tricks  - 
 
It's always worth worrying about performance in Apps Script, and every little bit helps. Here's a trick to take advantage of consecutive sequences when showing and hiding rows and columns. Just this small example shows a 4x speed improvement.

#gde   #googleappsscript   #blogpost  
6
Dimu Designs's profile photo
3 comments
 
I implemented something similar before, using the Array::reduce() function along with Range::setValues() to optimize updates to sequential rows/columns . Its a pretty awesome approach. Glad to see it documented. 
Add a comment...

Steve Webster

Tips & tricks  - 
 
I just noticed a warning in Chrome Dev Tools while I was testing an add-on about not using KeyEvent.keyIdentifier:
"'KeyboardEvent.keyIdentifier' is deprecated and will be removed in M53, around September 2016. See https://www.chromestatus.com/features/5316065118650368 for more details."

I visited the provided link within the warning (under Chrome version 54):
https://www.chromestatus.com/features/5316065118650368

"Remove the WebKit specific KeyEvent.keyIdentifier field. It is not specified in a current specification and has a number of interoperability concerns. The KeyboardEvent.key field is a suitable specified replacement for this field."

My guess was an old jQuery library version was throwing this warning. My script was using:
ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js and ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js so I visited https://developers.google.com/speed/libraries/ and replaced the recommend versions of:
ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js
ajax.googleapis.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js
and link:
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.0/themes/smoothness/jquery-ui.css" />

What you're looking at is a mostly comprehensive list of web platform features that have landed in Chromium, ordered chronologically by the milestone in which they were added. Features marked "No active development" are being considered or have yet to be started. Features marked "In development" ...
3
1
Add a comment...

Bruce Mcpherson
moderator

Tips & tricks  - 
 
In case anybody needs to embed the Google Bookreader in their Google Site, here's a dynamically sized gadget to do it.,

http://ramblings.mcpher.com/Home/excelquirks/analyticsandsites/bookviewer

#gde #googleappsscript #blogpost
10
1
Add a comment...

Hari Shankar Das

Tips & tricks  - 
 
Released "Mac style column file browser for Google Drive" on GitHub. Made with GAS.

https://github.com/hdas2012/column-file-browser
Blog post: http://goo.gl/wlzTVp
5
kenneth hicks's profile photo
 
Hey man completely off subject but I found no other way to thank you for your help the other day. I did find the issue with why the code seemed to be acting strange. It wasn't copying the data form the row above. It was copying the formulas that did that from the other sheet. Instead of .copyto() I added the {contentsOnly) constraint. Works like a charm now. So again Thank you
Add a comment...

Hari Shankar Das

Tips & tricks  - 
 
An awesome trick to show a date picker in a blank cell....in case you are not aware of this....
(I did not know this before :P)

Step 1: Right Click on cell in which you want to enter a date.
Step 2: Choose Data Validation.
Step 3: Set Criteria to "Date" is a valid date.
Step 4: SAVE
Step 5: Double click on the cell and the date picker will pop-out.

Found here.
http://webapps.stackexchange.com/questions/17238/adding-a-datepicker-in-google-spreadsheet
9
Stéphane Giron's profile photoRiël Notermans's profile photo
4 comments
 
Oh a BLANK cell


Aaaaaah :)
Add a comment...

Bruce Mcpherson
moderator

Tips & tricks  - 
 
A little while ago i released a library that showed a more functional approach to dealing with rows of data, like the kind you find in sheets. I must say that nowadays every time I touch a spreadsheet, I use this library as it saves a lot of time and mistakes.

I just added a couple of new methods to help deal with duplicate data.
getUniqueValues(columnName) returns all the unique values in a given column, and filterUnique (columnNames) reduces the data to get rid of rows that match on the given columnNames. Hope you find them useful

#gde   #blogpost   #googleappsscript  
14
Steve Webster's profile photoDavid Tew's profile photo
2 comments
 
Really very good.
Add a comment...

Daniel Bergheim

Tips & tricks  - 
 
Hi, I need a script that can copy from sheet to sheet in the same spreadsheet.
Is it possible to set the script to run within a given time and also have the oppurtunity to use the menyfunction manually?
lets say I want it to run 10:00, 12:00, and 14:00 
1
Valery Orloff's profile photoDaniel Bergheim's profile photo
4 comments
 
Thanks alot !!!! :)

Add a comment...

Bruce Mcpherson
moderator

Tips & tricks  - 
 
I had this small problem trying to share a form publicly. Not the link to form for people to fill in, but the link to the form so that people could make a copy of it to make their own version.

The Drive UI thinks you'd never need to do this and knows better than you, so bizarrely, it only allows sharing for edit only.

So.. what to do?

Apps script to the rescue...

function poke() {

var formId = "1n-27QxG_Ja3YWf-dYL-vfBSIgVYVD3wB92Cx9pQBPKI";
var file = DriveApp.getFileById(formId);

file.setSharing(
DriveApp.Access.ANYONE_WITH_LINK,
DriveApp.Permission.VIEW
);

Logger.log(file.getSharingAccess());
Logger.log(file.getSharingPermission());

}

#gde #googleappsscript #blogpost

7
Martin Hawksey's profile photoBruce Mcpherson's profile photo
4 comments
 
The form 'template' should be somehow disconnected from the responses. Bizarre that they are intertwined. It makes everything seem kind of one off...
Add a comment...

Martin Hawksey
moderator

Tips & tricks  - 
 
Add-ons monetisation - tips from +Steve Webster​ (plus some rich discussion in the original post thread)
4
Add a comment...

Hari Shankar Das

Tips & tricks  - 
 
A very nice trick ! useful while working with JSON and HTML service. Prettify JSON with syntax highlighting.

http://stackoverflow.com/questions/4810841/how-can-i-pretty-print-json-using-javascript
Fiddle: http://jsfiddle.net/KJQ9K/554/
7
Alexander Ivanov's profile photo
 
The highlight is really smart.
Add a comment...

Hari Shankar Das

Tips & tricks  - 
 
An useful script to allow others to book appointment slots in your Google Calendar. Works with a normal Gmail account (Google apps not needed).
Today Google Calendar has become an indispensable part of our life. It is very clean and intuitive. We can create events, add guests and ...
8
2
Michael Ellis's profile photoHari Shankar Das's profile photo
35 comments
 
+Michael Ellis Are you sure your script timezone and calendar timezone are the same ?
I have changed something in the script (at your url) on line 40. Now it should log the events which is getting overlapped with selected time range. It will be now easier for you track. Please run it and check again.
Add a comment...

Geetanjali Panda

Tips & tricks  - 
 
We have created a small script(custom functions) for commonly used Geo Data such as
1. Fetching place from zip code
2. Capital from country name
3. Currency from country name etc...

Hope you will like it. :)

http://goo.gl/sBM1RI
13
Claudio Santos's profile photoMichael Ellis's profile photo
2 comments
 
Pretty cool. Nice thing to share.
Add a comment...

Hari Shankar Das

Tips & tricks  - 
 
Created this unlisted add-on for exporting GitLab issues to Google Spreadsheet and to other formats like CSV, Excel and PDF.

http://goo.gl/OqJaIi

For developers, by developers ;)

6
Martin Hawksey's profile photoAlexander Ivanov's profile photo
4 comments
 
+Martin Hawksey​, thanks.
+Hari Shankar Das​, sorry, it is a typo of my T9
Add a comment...

Martin Hawksey
moderator

Tips & tricks  - 
 
Having recently worked with the Github API on an earlier project I thought it would be useful to extract a share the setup I used including example calls to get and write files to a Github repository using Google Apps Script

#gde   #googleappsscript   #blogpost  
In a recent post I demonstrated how you can use Google Apps Script to add new tweets to a downloaded Twitter archive hosted on Github Pages. This project used the Github API to commit files to the …
14
2
Alexander Ivanov's profile photoMartin Hawksey's profile photo
2 comments
 
+Alexander Ivanov thanks :) [Slightly modified open source Material Gaze theme for WP if anyone is interested https://wordpress.org/themes/material-gaze/ ]
Add a comment...