\n \n \n \n \n\n","There is an important difference between this upload example and the code used to open files: in addition to the standard view, an instance of ","DocsUploadView"," is added to the Picker object, thus providing upload capability.","For more information about this component and all other available views, please refer to the Google Picker Reference Guide.","\n\nLabels:\n\n\n\nDrive SDK\n\n\n","\nFire Up Your Computer: The 2012 Google Apps Developer Challenge is Here!\n","\nJune 6, 2012\n","Updated to add links to the #gappschallenge hashtag and to Google Apps Script.\n ","In the past year, the Google team has been engaging with local developers by running various Google conferences and Google+ Hackathons, showcasing creative applications, and supporting Tech Hubs. Since we are always looking for opportunities to encourage (and challenge!) you, we are looking forward to giving developers the opportunity to take on this year’s challenge, which will focus on Google Apps Script, Google Apps and Google Drive APIs.","With the Google Apps Developer Challenge, we hope developers across the globe will find new and innovative ways to use Apps Script, Apps and Drive APIs to build cool apps. This challenge is particularly unique as the APIs are available to a large community of developers who code in a variety of languages that include Java, PHP, Python, and .Net.","We will be working in collaboration with our Google Developer Groups (also known as GTUGs) and Google Business Groups to organize events and prepare for this challenge. Make sure to join your local community so that you are aware of meet ups.","How familiar are you with the various Google Apps and Drive APIs? If you aren’t familiar, make sure to read up about Google Apps Script, Google Apps and Drive APIs on Google Developers. Use the Chrome Web Store as a source of inspiration. Create an innovative application using Google Apps Script, Google Apps, and Drive APIs. If your application is the best within one of the three categories defined below in your region, you could win a prize of $20,000 dollars! Google is also committed to nurturing the next generation of computer scientists as well as encouraging more women to get into coding, so we have special prizes for all-student or all-female teams that make the second round — $1,000 dollars.","Fans Connect Online, one of the winners of last year’s Android Developer Challenge","The first round of submissions will start on the 24th of August 2012. The categories are","Enterprise / Small Business Solutions e.g., Accounting, Sales, Workflow, Collaboration","Social / Personal Productivity / Games / Fun","Education / Not for Profit / Water / Food & Hunger / Health","Make sure you read all the details about the competition on the Google Apps Developer Challenge page and follow the hashtag #gappschallenge on Google+ for any additional updates.","What are you waiting for? Get coding!","Chukwuemeka Afigbo","Chukwuemeka is a Program Manager at Google with the Emerging Markets Outreach team where he works closely with developers, startups, businesses and IT professionals in the region to successfully grow their business around Google Developer Tools and APIs. His current mission is to drive developer internet content in Sub Saharan Africa.","\nEmail Overload!\n","\nMay 31, 2012\n","Editor’s Note: This blog post is authored by Blair Kutzman, who developed the Gmail Delay Send script. - Eric Koleda\n ","Update: To start using this script simply open this page and follow the instructions.\n ","In today’s connected world, when you get your email could be just as important what’s in it. In 2011 over 107 trillion emails were sent to 1.97 billion internet users. Studies have shown that the average person can only effectively process 50 emails in a day. That leaves 100 emails per person per day that are not processed effectively. How can you be sure that the emails you send fall into the former category and not the latter?","Luckily, there are tools to assist with email overload. One such tool is Gmail Delay Send.","What is Gmail Delay Send?","Gmail Delay Send is a Google Apps Script that allows you to schedule emails to be delivered on a specified date and time. Using this tool you can ensure your email is sent to its destination at a time when you can capture your recipient’s full attention. For example, receiving an email at 4:59 PM on friday might not receive the same attention as an email received on Monday at 10:00 AM.","Designing Gmail Delay Send","A primary requirement of Gmail Delay Send was that it needed to work everywhere Gmail is available. There are already many browser add-ons and services available to enhance Gmail with similar functionality, so the purpose was not to duplicate that work. In order for the service to be available on all platforms, it needed to utilize native Gmail features.","We needed a native way that Gmail could:\n ","Store a composed, but unsent message.","Store in that composed message two pieces of metadata:","Whether or not the message meant to be sent at a later time","If it is, when the message should be sent","Gmail already contains a 'Draft' folder which is exactly what is required for item 1. The real problem was where and how to store the metadata for item 2, without any new Gmail functions. I chose to encode the metadata in the subject of the message because it would contain less text, which would mean a smaller chance of mis-parsing. Text such as “5 hours” and “next tuesday” were turned into a date-time using an open source library called datejs and a few modifications. See below for details of how this potentially cumbersome process was improved.","Basic structure","The script works as follows:\n ","The user composes an email, noting the date-time they want the message to be sent in their subject line after a delimiter (eg. \"Lets go surfing -- 3:30PM\")","The email is then saved as a draft and optionally a label is applied marking it as a message that we want to send at a later time.","When the script executes, all draft messages are checked (optionally looking at messages that have a specific label applied) to see if they should be sent now.","Usability improvements","Although using datejs to parse the dates from the subject line was easy to implement, it introduced some usability issues. First, how would a user know if a certain string can be parsed by datejs (eg. is “5 minutes before 4PM” parsable)? To assist the user in knowing which dates datejs supports, the script offers a mechanism to test a given string directly in the spreadsheet that Gmail Delay Send is installed inside of. In this way a user can test various strings to see if they are valid and, if so, when they would be sent. A wiki page is dedicated to helping people through this process.","Another possibly confusing part of using Gmail Delay Send was setting up triggers. Thanks to some recent improvements of the Script Services, this is now done automatically for users as they install.","Improving script reliability","Adding retry logic to the script was another important step in improving its reliability and user experience. Occasionally, users were getting emails from their trigger informing them that a certain Google Script API could not be contacted. Some retry logic was required to make things work correctly. As shown in the snippet below, the function executeCommand() takes any function and will try to execute it a specified number of times, retrying if an error is thrown:","function executeCommand(fp) { \n var msg;\n var ret_val;\n var last_error;\n\n for(var retries = NUM_RETRIES; retries > 0; retries -= 1) {\n try {\n ret_val = fp();\n break;\n }\n catch(err) {\n last_error = err;\n msg = \"Exception:\" + err + \" thrown executing function:\" + fp;\n debug_logs.push(msg);\n Logger.log(msg);\n Utilities.sleep(SLEEP_TIME);\n }\n }\n\n if(retries == 0) {\n msg = \"Attempted to execute command:\" + fp + \" \" + NUM_RETRIES +\n \" times without success. Error message: \" + last_error + \n \". Aborting :-(\";\n Logger.log(msg);\n throw(msg);\n }\n \n return ret_val;\n}","Using this method, statements like those below will automatically retry if the service is not available.","executeCommand( function() { GmailApp.send( … ) });\nexecuteCommand( function() { UrlFetchApp.urlFetch(url) } );","Summary","Gmail Delay Send was a fantastic project for learning about Google Apps Script and I hope that it will continue to prove useful to its users. If you’re interested in using Gmail Delay Send or just interested in the development process please check out the homepage or source.","Blair Kutzman","\n   ","Blair currently works on scan firmware at Hewlett Packard. When not scanning he likes to hang out with family, run and surf. Check out his profile for other projects.\n ","\nIntroducing Versions and Libraries in Apps Script\n","\nMay 22, 2012\n","Have you ever written a particular piece of code over and over again?  Or\n used scripts to do something that you thought others might want to do as well?\n  Starting today, you’ll be able to share and reuse those scripts as libraries,\n right from inside Google Apps Script.","Why use a Script Library","I often write scripts which check the National Weather Service for\n relevant weather-related information.  This allows me to send myself an email\n if it’s going to rain, reminding me to bring an umbrella to work, or to\n annotate my spreadsheet of running workouts with the temperature of the day.","Remembering how to query the National Weather Service every time I write\n a script is a daunting task, however.  They have a complicated XML format that\n  is tricky to parse.  As a result, I end up just copying and pasting code each\n time.  This is not only error-prone, but also has the big disadvantage that I\n have to fix all of my scripts one by one whenever the Weather Service’s XML\n format changes.","The code I use to query the National Weather Service is a perfect use\n case for a library.  By using a library, I no longer have to copy and paste\n code in my script project.  Since logic is centralized, updates need to be\n applied just once.  And now I am able to share my library with other\n developers who can benefit from the work I’ve already done.","Writing a Library","Libraries are written just like any other Apps Script project.  A good\n library has a clean API which is also well documented.  Here’s a code snippet\n from my WeatherService library:","\n/**\n * Queries the National Weather Service for the weather\n * forecast of the given address. Example:\n * \n *
\n * var chances = WeatherService\n *                 .getPrecipitation(\"New York, NY\");\n * var fridayChance = chances[“Friday”];\n * Logger.log(fridayChance + “% chance of rain on Friday!”);\n * 
\n * \n * @param {String} address The address to query the\n * temperature for, in any format accepted by\n * Google Maps (can be a street address, zip\n * code, city and state, etc)\n * \n * @returns {JsonObject} The precipitation forecast, as\n * map of period to percentage chance of\n * precipitation. Example:\n * \n *
\n * { Tonight: 50, Friday: 30, Friday Night: 40, ... }\n * 
\n */\nfunction getPrecipitation(address) {\n // Code for querying weather goes\n // here...\n}\n","\n Notice how detailed the documentation is. We know that good documentation\n makes for a great library. So, for every library Apps Script will also\n auto-generate a documentation page based on the code comments using the\n JSDoc format.  If you want a method in your code to not be exposed to users,\n simply end its name with an underscore.\n","Saving Versions","\n Before code can be used as a library, a version of it needs to be saved.\n  Versions are a new concept in Apps Script, and they represent a snapshot of\n your project which won’t change even as changes are made to the script code.\n Versions are useful because they allow you to change your library code without\n breaking existing users.  Once you’re happy with the changes you’ve made, you\n can then save a new version. Please see the user guide for saving a\n version and sharing your\n code as a library is easy.\n","Using Libraries","\n Using a library only takes a few steps. To be able to use a library, the owner\n of the library must share the library and its project key with you. You can\n follow these instructions\n to then use a library. To use this National Weather Service library, please\n visit this page\n for project key.\n","Useful Features of Libraries","Script Libraries come with three interesting features.","Documentation - In the Script Libraries dialog, you can click on the\n title link to navigate to documentation page for the library. See example\n of a generated documentation.\n ","Development Mode can be used to test changes to a library without\n saving a new version. See our User\n Guide for more details\n ","Autocomplete in Script Editor - Typing in the editor will\n auto-complete your library function names.","Interesting Libraries You Can Use","\n To get started on using Script Libraries, you can find a list of\n useful libraries contributed by two of our top contributors - James Ferreira\n and Romain Vialard. You can also find a detailed user guide on managing versions and\n libraries.\n We hope you enjoy using libraries.\n","Gustavo Moura"," Gustavo has been a Software Engineer at Google since 2007. He\n has been part of the Google Docs team since 2009. Prior to that, he\n worked on AdWords. In his free time he plays soccer.\n ","\n\n\n \n \n\n\n\n\n \n \n\n\n\n\n\n \n \n\n\n","\nLabels\n","\n \n ","\n\n.NET\n\n\n3\n\n","\n\n#io15\n\n\n1\n\n","\n\n#io16\n\n\n1\n\n","\n\nAdmin SDK\n\n\n10\n\n","\n\nAdministrative APIs\n\n\n31\n\n","\n\nAdSense\n\n\n1\n\n","\n\nanalytics\n\n\n5\n\n","\n\nAndroid\n\n\n8\n\n","\n\nAPI\n\n\n3\n\n","\n\nAPIs\n\n\n3\n\n","\n\nApp Engine\n\n\n5\n\n","\n\nApps\n\n\n1\n\n","\n\nApps Script\n\n\n118\n\n","\n\nAudit\n\n\n2\n\n","\n\nAuth\n\n\n5\n\n","\n\nbilling\n\n\n4\n\n","\n\nCharts\n\n\n2\n\n","\n\nChrome OS\n\n\n1\n\n","\n\nclassroom\n\n\n3\n\n","\n\nCloud Storage API\n\n\n1\n\n","\n\nCommunity\n\n\n1\n\n","\n\ndecks\n\n\n1\n\n","\n\nDesign\n\n\n1\n\n","\n\nDevelopers\n\n\n12\n\n","\n\nDirectory API\n\n\n3\n\n","\n\nDrive\n\n\n4\n\n","\n\nDrive SDK\n\n\n41\n\n","\n\nexecution API\n\n\n2\n\n","\n\nFirebase\n\n\n1\n\n","\n\nForms\n\n\n1\n\n","\n\nFreemium\n\n\n1\n\n","\n\nFusion Tables\n\n\n2\n\n","\n\nG Suite\n\n\n24\n\n","\n\nGadgets\n\n\n5\n\n","\n\nGmail\n\n\n7\n\n","\n\nGmail APIs\n\n\n23\n\n","\n\nGoogle\n\n\n3\n\n","\n\nGoogle APIs\n\n\n36\n\n","\n\nGoogle Apps\n\n\n33\n\n","\n\nGoogle Apps Marketplace\n\n\n7\n\n","\n\nGoogle Calendar API\n\n\n25\n\n","\n\nGoogle Classroom\n\n\n4\n\n","\n\nGoogle Cloud Directory\n\n\n1\n\n","\n\nGoogle Contacts API\n\n\n4\n\n","\n\nGoogle Data Protocol\n\n\n8\n\n","\n\ngoogle docs\n\n\n5\n\n","\n\nGoogle Docs API\n\n\n22\n\n","\n\nGoogle Drive\n\n\n8\n\n","\n\nGoogle Drive SDK\n\n\n7\n\n","\n\nGoogle Forms\n\n\n8\n\n","\n\nGoogle I/O\n\n\n3\n\n","\n\nGoogle Prediction API\n\n\n3\n\n","\n\nGoogle Profiles API\n\n\n2\n\n","\n\nGoogle sheets\n\n\n11\n\n","\n\nGoogle Sheets API\n\n\n7\n\n","\n\nGoogle Sites API\n\n\n5\n\n","\n\nGoogle Slides API\n\n\n10\n\n","\n\nGoogle Spreadsheets API\n\n\n5\n\n","\n\nGoogle Talk\n\n\n1\n\n","\n\nGoogle Tasks API\n\n\n8\n\n","\n\nGoogle+\n\n\n3\n\n","\n\ngooglenew\n\n\n1\n\n","\n\nGroups\n\n\n2\n\n","\n\nGSuite\n\n\n3\n\n","\n\nGuest Post\n\n\n43\n\n","\n\nHangouts Chat API\n\n\n1\n\n","\n\nI\n\n\n1\n\n","\n\nInbox\n\n\n1\n\n","\n\niOS\n\n\n2\n\n","\n\nissue tracker\n\n\n1\n\n","\n\nISVs\n\n\n2\n\n","\n\njava\n\n\n1\n\n","\n\nJavaScript\n\n\n6\n\n","\n\nmarketing\n\n\n3\n\n","\n\nMarketplace\n\n\n47\n\n","\n\nMarketplace ISV Guest\n\n\n21\n\n","\n\nMigration\n\n\n2\n\n","\n\nMobile\n\n\n5\n\n","\n\nmpstaffpick\n\n\n1\n\n","\n\noauth\n\n\n16\n\n","\n\nOpenID\n\n\n8\n\n","\n\nPHP\n\n\n1\n\n","\n\npresentations\n\n\n1\n\n","\n\npython\n\n\n7\n\n","\n\nrealtime API\n\n\n2\n\n","\n\nResellers\n\n\n2\n\n","\n\nRuby\n\n\n1\n\n","\n\nSaaS\n\n\n1\n\n","\n\nsecurity\n\n\n5\n\n","\n\nSheets API\n\n\n3\n\n","\n\nspreadsheets\n\n\n3\n\n","\n\nStaff Picks\n\n\n2\n\n","\n\ntool\n\n\n1\n\n","\n\ntools\n\n\n2\n\n","\n\ntutorials\n\n\n2\n\n","\n\nvideo\n\n\n4\n\n","\n\nvideos\n\n\n1\n\n","\n\nwebinar\n\n\n2\n\n","\n \n ","\nArchive\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2018\n\n","\nJul\n","\nJun\n","\nMay\n","\nMar\n","\nFeb\n","\nJan\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2017\n\n","\nDec\n","\nNov\n","\nOct\n","\nSep\n","\nAug\n","\nApr\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2016\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2015\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2014\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2013\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2012\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2011\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2010\n\n","Feed","Google","on","Follow @gsuitedevs","\nCompany-wide\n","Official Google Blog","Public Policy Blog","Student Blog","\nProducts\n","Android Blog","Chrome Blog","Lat Long Blog","\nDevelopers\n","Developers Blog","Ads Developer Blog","Android Developers Blog","\n Google\n ","\n Privacy\n ","\n Terms\n "]}