<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-576799719977527868</id><updated>2012-02-23T16:42:55.221+01:00</updated><category term='sendEmail'/><category term='Logger'/><category term='onEdit'/><category term='ContactsApp'/><category term='MailApp'/><category term='flush'/><category term='Ui Services'/><category term='createApplication'/><category term='getAllCalendars'/><category term='Trigger'/><category term='UrlFetchApp'/><category term='getContentText'/><category term='addMenu'/><category term='fetch'/><category term='getHistoricalStockInfo'/><category term='onOpen'/><category term='getResponseCode'/><category term='CalendarApp'/><category term='getStockInfo'/><category term='Browser'/><category term='msgBox'/><category term='getContactGroups'/><category term='log'/><category term='stockInfo'/><category term='SpreadsheetApp'/><category term='inputBox'/><category term='FinanceApp'/><category term='UiApp'/><title type='text'>Google Apps Script</title><subtitle type='html'>Automate tasks across Google Products</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-3303440004612666538</id><published>2011-01-11T10:09:00.001+01:00</published><updated>2011-01-11T10:11:25.791+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='createApplication'/><category scheme='http://www.blogger.com/atom/ns#' term='SpreadsheetApp'/><category scheme='http://www.blogger.com/atom/ns#' term='Ui Services'/><category scheme='http://www.blogger.com/atom/ns#' term='UiApp'/><title type='text'>Eigene Dialog-Box mit Google Apps Script erstellen</title><content type='html'>Die Möglichkeiten bei der Interaktion mit dem Benutzer sind bei der Verwendung von &lt;a href="http://google-apps-script.blogspot.com/2011/01/interaktion-teil-1-message-box.html"&gt;Message-&lt;/a&gt; und &lt;a href="http://google-apps-script.blogspot.com/2011/01/interaktion-teil-2-eingabe-box.html"&gt;Eingabe-Boxen&lt;/a&gt; für viele Fälle vollkommen ausreichend. Doch gibt es auch Anwendungsgebiete, in denen man zum Beispiel die Breite und Höhe der Box selber bestimmen möchte (damit der enthaltene Text nicht umbricht) oder man Buttons mit Texten versehen möchte, die standardmäßig nicht zur Verfügung stehen.&lt;br /&gt;&lt;br /&gt;Um nun all das umzusetzen, bietet Google Apps Script die &lt;a href="http://code.google.com/intl/en/googleapps/appsscript/service_ui.html"&gt;Ui Services&lt;/a&gt; an. Mit diesen lassen sich fast alle Elemente erstellen, die man in die Google Anwendungen sieht.&lt;br /&gt;&lt;br /&gt;Das folgende Beispiel zeigt eine ganz einfache eigene Anwendung innerhalb eines Tabellen-Dokuments, welche nur eine Box erstellt und der Titel der Box definiert wird.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myDialogBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;spreadsheet&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveSpreadsheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;app&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;UiApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;createApplication&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setTitle&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Dialogbox"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;spreadsheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;show&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Führt man diese Funktion aus, erhält man eine solche Dialog-Box:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_SBxyG5AgEOc/TSwdz9o8DmI/AAAAAAAAFkM/aCKevN8YT0E/s1600/Eigene-Dialog-Box-1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="216" src="http://4.bp.blogspot.com/_SBxyG5AgEOc/TSwdz9o8DmI/AAAAAAAAFkM/aCKevN8YT0E/s400/Eigene-Dialog-Box-1.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Einer solchen Box kann man nun verschiedene Elemente hinzufügen. Texte, Eingabefelder, Checkboxen, Buttons usw. Je nach Bedarf. Die Werte dieser Elemente kann man dann übrigens auch in die Tabelle übertragen oder anhand der Werte Aktionen mit der Tabelle durchführen. Aber das würde für den Anfang an dieser Stelle etwas zu weit führen. Um es gemütlich angehen zu lassen, zeigt das folgende Beispiel zunächst einmal nur, wie man die Höhe und Breite der Box festlegt sowie einen Text und einen Button zum Schließen der Box hinzufügt.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myDialogBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;spreadsheet&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveSpreadsheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;app&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;UiApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;createApplication&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setHeight&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;100&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setWidth&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;300&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setTitle&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Dialogbox"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;text&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;createLabel&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Hier steht der Text."&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;add&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;text&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;closeButton&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;createButton&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Schließen"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;add&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;closeButton&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;handler&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;createServerClickHandler&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"closeDialogBox"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;closeButton&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;addClickHandler&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;handler&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;spreadsheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;show&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;closeDialogBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;e&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;app&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;UiApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveApplication&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;close&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;return&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;app&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Führt man diese Funktion ("myDialogBox") aus, erhält man eine solche Dialog-Box:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_SBxyG5AgEOc/TSweCCPpTJI/AAAAAAAAFkQ/5HqVS7PebS0/s1600/Eigene-Dialog-Box-2.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_SBxyG5AgEOc/TSweCCPpTJI/AAAAAAAAFkQ/5HqVS7PebS0/s1600/Eigene-Dialog-Box-2.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Wie man dann Eingabeelemente in einer solchen Box erstellt und mit den Werten weiterarbeitet ... das gibt es in einem kommenden Artikel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-3303440004612666538?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/3303440004612666538/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/eigene-dialog-box-mit-google-apps.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/3303440004612666538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/3303440004612666538'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/eigene-dialog-box-mit-google-apps.html' title='Eigene Dialog-Box mit Google Apps Script erstellen'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_SBxyG5AgEOc/TSwdz9o8DmI/AAAAAAAAFkM/aCKevN8YT0E/s72-c/Eigene-Dialog-Box-1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-2327520408847090305</id><published>2011-01-07T15:58:00.001+01:00</published><updated>2011-01-07T15:58:36.202+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='onEdit'/><category scheme='http://www.blogger.com/atom/ns#' term='Trigger'/><title type='text'>Automatischer Funktionsaufruf beim Bearbeiten einer Tabelle</title><content type='html'>Möchte man automatisch eine Google Apps Script Funktion aufrufen, sobald eine Tabelle bearbeitet wurde, hat man dafür zwei Möglichkeiten:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://code.google.com/intl/en/googleapps/appsscript/guide_events.html#Simple"&gt;Einfache Event Handler&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/intl/en/googleapps/appsscript/guide_events.html#Installable"&gt;Installierbare Event Handler&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;Einfacher Event Handler sind bereits in Google Apps Script eingebaut. Um sie zu nutzen, muss man nur eine Funktion mit einem speziellen Namen (&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;onOpen()&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;onEdit()&lt;/span&gt; oder &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;onInstall()&lt;/span&gt;) erstellen. Der Inhalt der Funktion wird dann beim Eintreten des entsprechenden Events ausgeführt.&lt;br /&gt;&lt;br /&gt;Um nun eine Funktion nach dem Bearbeiten einer Tabelle auszuführen, erstellt man eine Funktion mit dem Namen “onEdit”. Dieser wird ein Parameter "event" übergeben, der ein Objekt mit dem aktuellen Tabellen-Dokument enthält. Um das alles einmal auszuprobieren erstellt an ein neues Tabellen-Dokument, öffnet den Skripteditor (Tools -&amp;gt; Skripte -&amp;gt; Skripteditor) und erstellt folgende Funktion:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;onEdit&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;event&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Tabelle wurde bearbeitet."&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Nun noch die Funktion unter einem beliebigen Namen speichern und eine Änderung an der aktuellen Tabelle vornehmen. Voilà, eine Message-Box erscheint.&lt;br /&gt;&lt;br /&gt;Doch warum die Übergabe des Parameters "event"? Was kann man damit machen? Ganz einfach. Der Inhalt dieses Parameters ist, wie bereits weiter oben geschrieben - aber hier sicherheitshalber ein zweites Mal, ein Objekt, welches das Tabellen-Dokument (Spreadsheet) enthält. Aus diesem Objekt kann man nun zum Beispiel die Information auslesen, welche Tabellenzelle gerade aktiv ist.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;onEdit&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;event&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;rowIndex&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;event&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;source&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveCell&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRowIndex&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;columnIndex&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;event&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;source&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveCell&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getColumnIndex&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Spalte: "&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;rowIndex&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Zeile: "&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;columnIndex&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Sind mehrere Tabellenzellen aktiv, wird übrigens immer die oberste linke zurückgegeben. Ach noch was: Führt man diese Funktion innerhalb des Skripteditors aus, erhält man eine Fehlermeldung wie diese hier: &lt;span class="Apple-style-span" style="color: red;"&gt;TypeError: Cannot read property "source" from undefined. (line 2)&lt;/span&gt;. Keine Sorge. Es ist alles in Ordnung mit der Funktion. Funktion speichern, zur Tabelle wechseln und eine Änderung vornehmen. Geht!&lt;br /&gt;&lt;br /&gt;So, nun zur zweiten Möglichkeit: Installierbare Event Handler. Komischer Name, aber etwas Besseres als Übersetzung für "Installable Event Handlers" wollte mir einfach nicht einfallen.&lt;br /&gt;&lt;br /&gt;Hierbei ist der Name der Funktion nicht ausschlaggebend. Zum Ausprobieren erstellt man einfach eine Funktion mit dem Namen "myOnEdit":&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myOnEdit&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;event&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Tabelle wurde bearbeitet."&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Nun wählt man im Skripteditor den Menüpunkt Triggers -&amp;gt; All your Triggers aus und klickt in der angezeigten Dialogbox auf den Link "No triggers set up. Click here to add one now." (wenn man noch keinen Trigger angelegt hat) beziehungsweise "Add a new trigger" (wenn man bereits einen Trigger angelegt hat). In der Spalte "Run" wählt man aus der Select-Box die Option "myOnEdit" aus und in der Spalte "Events" wählt man bei der ersten Select-Box die Option "From spreadsheet" und bei der zweiten Select-Box die Option "On edit" aus. Speichern.&lt;br /&gt;&lt;br /&gt;Zum Testen kann man nun Änderungen an der Tabelle durchführen und es erscheint nach jeder Änderung die Message-Box.&lt;br /&gt;&lt;br /&gt;Fertig!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-2327520408847090305?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/2327520408847090305/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/automatischer-funktionsaufruf-beim.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/2327520408847090305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/2327520408847090305'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/automatischer-funktionsaufruf-beim.html' title='Automatischer Funktionsaufruf beim Bearbeiten einer Tabelle'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-7368542846405121264</id><published>2011-01-06T22:10:00.000+01:00</published><updated>2011-01-06T22:10:37.391+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Logger'/><category scheme='http://www.blogger.com/atom/ns#' term='log'/><title type='text'>Debugging-Logs von Google Apps Script nutzen</title><content type='html'>Beim Erstellen eines Scripts kann es mitunter nützlich sein, wenn man als Entwickler im Verlauf des Scripts einige Werte überprüft. Dazu könnte man zum Beispiel die Message-Box verwenden. Dies würde aber den Ablauf des Scripts etwas stören. Praktischer ist es, auf die zur Verfügung stehenden Debugging-Logs zurückzugreifen. In diese kann man im Verlauf eines Scripts beliebig Daten schreiben und sich dann am Ende alles in Ruhe ansehen.&lt;br /&gt;&lt;br /&gt;In der folgenden einfachen Beispiel-Funktion wird eine for-Schleife durchlaufen. Bei jedem Schleifendurchlauf wird der Zählerwert mit der Methode &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;a href="http://code.google.com/intl/de-DE/googleapps/appsscript/class_logger.html#log"&gt;log()&lt;/a&gt;&lt;/span&gt; der Klasse &lt;a href="http://code.google.com/intl/de-DE/googleapps/appsscript/class_logger.html"&gt;Logger&lt;/a&gt; ins Log geschrieben:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myLogger&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;for&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;0&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;&amp;lt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;10&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;++&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Logger&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;log&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"i = "&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Nach dem Ausführen der Funktion kann man sich das Debugging-Log über Ansicht -&amp;gt; Protokolle... ansehen.&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_SBxyG5AgEOc/TSYmDKvGY7I/AAAAAAAAFkE/N-imhOQL8Qg/s1600/Debugging-Log-1.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Den Inhalt des Debugging-Logs kann man aber auch per Script abrufen, wenn man dies möchte. Google Apps Script stellt dafür die Methode &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;a href="http://code.google.com/intl/de-DE/googleapps/appsscript/class_logger.html#getLog"&gt;getLog()&lt;/a&gt;&lt;/span&gt; der Klasse &lt;a href="http://code.google.com/intl/de-DE/googleapps/appsscript/class_logger.html"&gt;Logger&lt;/a&gt; zu Verfügung. Das folgende Beispiel zeigt, wie man den Inhalt des Debugging-Logs über eine Message-Box ausgibt:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myLogger&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;for&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;0&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;&amp;lt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;10&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;++&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Logger&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;log&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"i = "&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Logger&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getLog&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Und so schaut es dann aus:&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_SBxyG5AgEOc/TSYvo_IEHTI/AAAAAAAAFkI/v-OnEVvgqV8/s1600/Debugging-Log-2.gif" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-7368542846405121264?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/7368542846405121264/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/debugging-logs-von-google-apps-script.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/7368542846405121264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/7368542846405121264'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/debugging-logs-von-google-apps-script.html' title='Debugging-Logs von Google Apps Script nutzen'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_SBxyG5AgEOc/TSYmDKvGY7I/AAAAAAAAFkE/N-imhOQL8Qg/s72-c/Debugging-Log-1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-8394646435858846446</id><published>2011-01-06T16:25:00.001+01:00</published><updated>2011-01-06T16:26:08.951+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SpreadsheetApp'/><category scheme='http://www.blogger.com/atom/ns#' term='addMenu'/><title type='text'>Eigene Menüs einem Tabellen-Dokument hinzufügen</title><content type='html'>Vorhandene Google Apps Scripte eine Tabellen-Dokuments über das Menü Tools -&amp;gt; Skripte -&amp;gt; Verwalten von... zu starten ist zwar nicht allzu schwer, aber nicht sonderlich komfortabel. Um den Weg für den Aufruf eines Scripts zu verkürzen und auch den nicht so technisch versierten Nutzern etwas unter die Arme zu greifen, kann man mittels Google Apps Script über die Methode &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_spreadsheet.html#addMenu"&gt;addMenu()&lt;/a&gt;&lt;/span&gt; eigene neue Menüeinträge erstellen und mit beliebigen Funktionen verknüpfen.&lt;br /&gt;&lt;br /&gt;Damit die neuen Menüpunkte beim Öffnen des Tabellen-Dokuments automatisch hinzugefügt werden, erstellt man eine Funktion mit dem Namen &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;onOpen()&lt;/span&gt; (siehe &lt;a href="http://code.google.com/intl/en/googleapps/appsscript/guide_events.html"&gt;Events&lt;/a&gt;). Diese wird durch das System selbständig gestartet, sobald das Tabellen-Dokument geöffnet wird.&lt;br /&gt;&lt;br /&gt;Das folgende Beispiel zeigt, wie man der Menüleiste einen neuen eigenen Hauptmenüpunkt "Mein Menü" mit drei Untermenüpunkten ("Eintrag 1", "Eintrag 2", "Eintrag 3") hinzufügt. Jeder Untermenüpunkt wird dabei mit einer eigenen Funktion verknüpft. Dies wird aufgerufen, sobald der Benutzer auf diesen klickt.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;onOpen&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;spreadsheet&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveSpreadsheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;spreadsheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;addMenu&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Mein Menü"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;[&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;functionName&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"function1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 2"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;functionName&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"function2"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 3"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;functionName&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"function3"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;function1&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 1 geklickt"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;function2&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 2 geklickt"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;function3&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 3 geklickt"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Führt man nun die Funktion &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;onOpen()&lt;/span&gt; zum Test einmal aus, dann sieht man, wie nach dem letzten Standard-Menüpunkt "Hilfe" der neue Menüpunkt "Mein Menü" hinzugefügt wurde.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_SBxyG5AgEOc/TSXePt9XCqI/AAAAAAAAFj8/BtsFcIAZ7z8/s1600/Menue-1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="96" src="http://2.bp.blogspot.com/_SBxyG5AgEOc/TSXePt9XCqI/AAAAAAAAFj8/BtsFcIAZ7z8/s400/Menue-1.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Möchte man die Untermenüpunkte etwas gruppieren, kann man zwischen diesen auch Trennlinien einfügen. Das folgende Beispiel zeigt, wie man eine solche Trennlinie zwischen dem zweiten und dritten Untermenüpunkt einfügt.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;onOpen&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;spreadsheet&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveSpreadsheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;spreadsheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;addMenu&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Mein Menü"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;[&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;functionName&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"function1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 2"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;functionName&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"function2"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;null&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 3"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;functionName&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"function3"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;function1&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 1 geklickt"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;function2&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 2 geklickt"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;function3&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Eintrag 3 geklickt"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Im Tabellen-Dokument sieht dies nun so aus:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_SBxyG5AgEOc/TSXerSG_NfI/AAAAAAAAFkA/7hqBFFhGRvc/s1600/Menue-2.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="106" src="http://1.bp.blogspot.com/_SBxyG5AgEOc/TSXerSG_NfI/AAAAAAAAFkA/7hqBFFhGRvc/s400/Menue-2.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-8394646435858846446?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/8394646435858846446/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/eigene-menues-einem-tabellen-dokument.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/8394646435858846446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/8394646435858846446'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/eigene-menues-einem-tabellen-dokument.html' title='Eigene Menüs einem Tabellen-Dokument hinzufügen'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_SBxyG5AgEOc/TSXePt9XCqI/AAAAAAAAFj8/BtsFcIAZ7z8/s72-c/Menue-1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-6354952104016053001</id><published>2011-01-05T12:44:00.005+01:00</published><updated>2011-01-05T12:48:30.872+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UrlFetchApp'/><category scheme='http://www.blogger.com/atom/ns#' term='SpreadsheetApp'/><category scheme='http://www.blogger.com/atom/ns#' term='fetch'/><category scheme='http://www.blogger.com/atom/ns#' term='getContentText'/><category scheme='http://www.blogger.com/atom/ns#' term='Trigger'/><title type='text'>Inhaltsänderung einer Webseite automatisch überwachen</title><content type='html'>Möchte man automatisch per E-Mail informiert werden, wenn sich der Inhalt einer bestimmten Webseite ändert, kann man dies mittels Google Apps Script realisieren. Dazu benötigt man zunächst eine beliebige App, die Google Apps Script unterstützt - zum Beispiel Text &amp;amp; Tabellen oder Sites. Hier erstellt man eine Funktion, die den Inhalt (also den HTML-Quelltext) einer Webseite abruft, mit dem bei einem vorherigen Funktionsaufruf gespeicherten Inhalt vergleicht und dann innerhalb des Dokuments speichert. Hat sich der Inhalt geändert, wird eine E-Mail verschickt. Diese Funktion lässt man nun über einen zeitbasierten Trigger automatisch in einem beliebigen Intervall aufrufen. Fertig.&lt;br /&gt;&lt;br /&gt;Um es etwas anschaulicher zu gestalten habe ich mal eine solche Funktion erstellt, welche innerhalb einer Tabelle ausgeführt wird. Bitte zum Ausprobieren die eingetragene E-Mail-Adresse "max@mustermann.de" in die eigene ändern!&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;checkWebContent&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;url&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"http://www.apple.com/de/iphone/"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;response&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;UrlFetchApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;fetch&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;url&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;newContent&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;response&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getContentText&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;sheet&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveSheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;cell&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"A1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;oldContent&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;cell&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;if&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;oldContent&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;!=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;newContent&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"A1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;newContent&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;MailApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;sendEmail&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"max@mustermann.de"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Geänderter Inhalt"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Der Inhalt der Seite "&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;url&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;" hat sich geändert."&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;​&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Funktion unter dem Namen "checkWebContent" speichern.&lt;br /&gt;&lt;br /&gt;Für einen ersten Test, kann man diese Funktion mal im Skripteditor starten. Man sollte hierbei bereits eine E-Mail erhalten.&lt;br /&gt;&lt;br /&gt;Nun geht es an den zeitbasierten Trigger zur automatischen Ausführung. Hierzu wählt man im Skripteditor den Menüpunkt Triggers -&amp;gt; All your Triggers aus und klickt in der angezeigten Dialogbox auf den Link "No triggers set up. Click here to add one now." (wenn man noch keinen Trigger angelegt hat) beziehungsweise "Add a new trigger" (wenn man bereits einen Trigger angelegt hat). In der Spalte "Run" wählt man den Namen der Funktion aus, in der Spalte "Events" wählt man "Time-driven" aus und definiert einen Intervall. Der folgende Screenshot zeigt einen zeitbasierten Trigger, welcher die Funktion &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;checkWebContent&lt;/span&gt; jede Minute ausführt. Speichern.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_SBxyG5AgEOc/TSRZl7_1fGI/AAAAAAAAFjs/Euo4YuA16Mk/s1600/Trigger.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="75" src="http://3.bp.blogspot.com/_SBxyG5AgEOc/TSRZl7_1fGI/AAAAAAAAFjs/Euo4YuA16Mk/s400/Trigger.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Scripteditor schließen, Tabelle speichern, Tabelle schließen. Fertig. Nun kann man den Posteingang beobachten und geduldig auf die Benachrichtigungen warten. Die im oben genannten Beispielcode genannte Website wird sich sicher nicht so häufig ändern ... für mehr Benachrichtigungen einfach mal den URL "http://news.google.de/" einsetzen. Die E-Mails sollten dann im Minutentakt im Posteingang landen.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-6354952104016053001?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/6354952104016053001/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/inhaltsaenderung-einer-webseite.html#comment-form' title='1 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/6354952104016053001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/6354952104016053001'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/inhaltsaenderung-einer-webseite.html' title='Inhaltsänderung einer Webseite automatisch überwachen'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_SBxyG5AgEOc/TSRZl7_1fGI/AAAAAAAAFjs/Euo4YuA16Mk/s72-c/Trigger.gif' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-95749102966843691</id><published>2011-01-05T09:59:00.001+01:00</published><updated>2011-01-05T10:02:16.468+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='inputBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Browser'/><title type='text'>Interaktion Teil 2 - Eingabe-Box</title><content type='html'>Nachdem es im &lt;a href="http://google-apps-script.blogspot.com/2011/01/interaktion-teil-1-message-box.html"&gt;ersten Teil&lt;/a&gt; zum Thema Interaktion mit dem Benutzer um die Message-Box ging, soll nun im zweiten Teil dieses Thema um die Eingabe-Box erweitert werden. Über die Message-Box kann man den Benutzer zwar eine einfache Frage stellen, auf die er allerdings nur sehr begrenzt (zum Beispiel mit "Ja" oder "Nein") antworten kann. Möchte man aber den Namen erfragen, muss man sich ein anderes Hilfsmittel suchen: &lt;b&gt;Die Eingabe-Box&lt;/b&gt;. Diese hat zusätzlich zu den bekannten Elementen der Message-Box noch ein einzeiliges Eingabefeld. Eine solche Eingabe-Box wird in Google Apps Script mit der Methode &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_browser.html#inputBox"&gt;inputBox()&lt;/a&gt;&lt;/span&gt; der &lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_browser.html"&gt;Browser-Klasse&lt;/a&gt; erzeugt.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myInputBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;inputBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Bitte geben Sie Ihren Namen ein:"&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Wird diese Funktion ausgeführt, dann sieht der Benutzer diese Eingabe-Box mit einem Titel, einem Schließen-Button in der rechten oberen Ecke, die Frage und einem OK-Button:&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_SBxyG5AgEOc/TSQwxIUj8EI/AAAAAAAAFjY/tTopnW7tqwg/s1600/InputBox-1.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Über einen zweiten Parameter kann man zusätzlich noch definieren, welche Buttons in der Box angezeigt werden. Das folgende Beispiel zeigt, wie man einen OK- und einen Abbrechen-Button in die Box setzt:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myInputBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;inputBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Bitte geben Sie Ihren Namen ein:"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;Buttons&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;OK_CANCEL&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Wird diese Funktion ausgeführt, dann sieht der Benutzer diese Eingabe-Box mit einem Titel, einem Schließen-Button in der rechten oberen Ecke, die Frage, einem OK- sowie einen Abbrechen-Button:&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_SBxyG5AgEOc/TSQw-_jwZMI/AAAAAAAAFjc/xWkpVj05eLI/s1600/InputBox-2.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Alle möglichen Kombinationen der Buttons findet man übrigens &lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_buttons.html"&gt;hier&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Wie man in den bisherigen Beispielen gesehen hat, wird das Ergebnis (oder auch Rückgabewert) der Methode &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_browser.html#inputBox"&gt;inputBox()&lt;/a&gt;&lt;/span&gt; in der Variable &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;name&lt;/span&gt; gespeichert. Bei der Weiterverarbeitung dieses Wertes gilt es nun zu unterscheiden, ob der Benutzer wirklich einen Namen eingegeben hat, oder auf den Abbrechen-Button geklickt hat. Im folgenden Beispiel wird eine Message-Box angezeigt, wenn der Benutzer einen Namen eingegeben hat und auf den OK-Button geklickt hat. Andernfalls wird nichts gemacht.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myInputBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;inputBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Bitte geben Sie Ihren Namen ein:"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;Buttons&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;OK_CANCEL&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;if&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;!=&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"cancel"&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;&amp;amp;&amp;amp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;!=&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;""&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Hallo "&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"."&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_SBxyG5AgEOc/TSQxmYtD-2I/AAAAAAAAFjg/uRkvgq5DMPE/s1600/InputBox-3.gif" /&gt;&amp;nbsp;&amp;nbsp;&lt;img border="0" src="http://3.bp.blogspot.com/_SBxyG5AgEOc/TSQxpEgszSI/AAAAAAAAFjk/mGg0DELPVwo/s1600/InputBox-4.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Die Eingabe-Box bietet, wie auch die Message-Box, die Möglichkeit, den Titel der Box selbst zu definieren. Dies geschieht über einen weiteren Parameter der Methode &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_browser.html#inputBox"&gt;inputBox()&lt;/a&gt;&lt;/span&gt;. Hierbei ist unbedingt zu beachten, dass man beim Setzen des Titels alle drei Parameter (Titel, Text, Buttons) angeben muss.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myInputBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;inputBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Frage"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Bitte geben Sie Ihren Namen ein:"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;Buttons&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;OK_CANCEL&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;if&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;!=&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"cancel"&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;&amp;amp;&amp;amp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;!=&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;""&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Hallo "&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"."&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Wird diese Funktion ausgeführt, dann sieht der Benutzer diese Eingabe-Box mit dem selbst definierten Titel, einem Schließen-Button in der rechten oberen Ecke, der Frage, einem OK- sowie einen Abbrechen-Button:&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_SBxyG5AgEOc/TSQyAyroboI/AAAAAAAAFjo/8zWr4EnmaXk/s1600/InputBox-5.gif" /&gt;&lt;br /&gt;&lt;br /&gt;So, das zum Thema "Eingabe-Box". Demnächst mehr...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-95749102966843691?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/95749102966843691/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/interaktion-teil-2-eingabe-box.html#comment-form' title='1 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/95749102966843691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/95749102966843691'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/interaktion-teil-2-eingabe-box.html' title='Interaktion Teil 2 - Eingabe-Box'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_SBxyG5AgEOc/TSQwxIUj8EI/AAAAAAAAFjY/tTopnW7tqwg/s72-c/InputBox-1.gif' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-5548864884729981134</id><published>2011-01-04T14:00:00.001+01:00</published><updated>2011-01-04T14:04:58.799+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='msgBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Browser'/><title type='text'>Interaktion Teil 1 - Message-Box</title><content type='html'>Automation schön und gut, aber so richtig interessant wird es bei Google Apps Script erst durch die Interaktion mit dem Benutzer. Ich möchte aus diesem Grund an einigen Beispielen zeigen, wie ein Script mit dem Benutzer (oder der Benutzer mit dem Script ... ganz wie man will) interagieren kann.&lt;br /&gt;&lt;br /&gt;Fangen wir mit einem ganz einfachen Beispiel an: Die Message-Box. Vielen Entwicklern, die bereits vor Google Apps Script mit JavaScript gearbeitet haben, wird die &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;alert()&lt;/span&gt;-Funktion sehr geläufig sein. Das passende Entsprechung in Google Apps Script ist &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_browser.html#msgBox"&gt;msgBox()&lt;/a&gt;&lt;/span&gt;. Dies ist eine Methode der &lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_browser.html"&gt;Browser-Klasse&lt;/a&gt;. Das folgende Beispiel zeigt, wie man eine solche Message-Box aufruft:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myMessageBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Das ist eine Message-Box."&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Wird diese Funktion ausgeführt, dann sieht der Benutzer diese Message-Box mit einem Titel, einem Schließen-Button in der rechten oberen Ecke, dem Text und einem OK-Button:&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_SBxyG5AgEOc/TSMYJsdBDqI/AAAAAAAAFjM/wamM9DAgXis/s1600/Message-Box-1.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Einfach. Oder? Aber man möchte dem Benutzer nicht immer nur etwas mitteilen, sondern eventuell auch etwas fragen. Damit er dann auch entsprechend antworten kann, muss man ihm natürlich auch die passende Möglichkeit dazu bieten ... über die zur Verfügung gestellten Buttons. So kann man zum Beispiel fragen, ob der Benutzer heute Geburtstag hat und ihm für seine Antwort die Buttons "Ja" und "Nein" anbieten. Dies erreicht man über eine zusätzlichen Parameter der Methode.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myMessageBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Haben Sie heute Geburtstag?"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;Buttons&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;YES_NO&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Wird diese Funktion ausgeführt, dann sieht der Benutzer diese Message-Box mit einem Titel, einem Schließen-Button in der rechten oberen Ecke, der Frage und den Buttons "Ja" und "Nein":&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_SBxyG5AgEOc/TSMYoKViQxI/AAAAAAAAFjQ/owucvH424nk/s1600/Message-Box-2.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Alle möglichen Kombinationen der Buttons findet man übrigens &lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_buttons.html"&gt;hier&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Aber was bringt die Frage, wenn man nicht angemessen darauf reagieren kann? Nichts. So muss man nun noch die Antwort des Benutzers abfragen und weiter mit im interagieren. Wie wäre es mit einem "Herzlichen Glückwunsch!"?&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myMessageBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;answer&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Haben Sie heute Geburtstag?"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;Buttons&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;YES_NO&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;switch&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;answer&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;case&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"yes"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Herzlichen Glückwunsch!"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;break&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;case&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"no"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Schade."&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;break&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Rein funktionell ist es das, was eine Message-Box kann. Allerdings ist der Standard-Titel "Google Apps Script" nicht so wirklich toll anzusehen. Diesen kann man ebenfalls über einen weiteren Parameter der Methode ändern. Hierbei ist allerdings zu beachten, dass man beim Setzen des Titels dann alle drei Parameter (Titel, Text, Buttons) angeben muss.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myMessageBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;answer&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Frage"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Haben Sie heute Geburtstag?"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;Buttons&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;YES_NO&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;switch&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;answer&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;case&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"yes"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Herzlichen Glückwunsch!"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;break&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;case&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"no"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Schade."&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;break&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Wird diese Funktion ausgeführt, dann sieht der Benutzer diese Message-Box mit dem selbst definierten Titel, einem Schließen-Button in der rechten oberen Ecke, der Frage und den Buttons "Ja" und "Nein":&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_SBxyG5AgEOc/TSMZRk8fuRI/AAAAAAAAFjU/VeXPzMdkDWk/s1600/Message-Box-3.gif" /&gt;&lt;br /&gt;&lt;br /&gt;So, das zum Thema "Message-Box". Demnächst mehr...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-5548864884729981134?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/5548864884729981134/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/interaktion-teil-1-message-box.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/5548864884729981134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/5548864884729981134'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/interaktion-teil-1-message-box.html' title='Interaktion Teil 1 - Message-Box'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_SBxyG5AgEOc/TSMYJsdBDqI/AAAAAAAAFjM/wamM9DAgXis/s72-c/Message-Box-1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-1916152204363391372</id><published>2011-01-04T11:54:00.001+01:00</published><updated>2011-01-04T14:01:16.700+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SpreadsheetApp'/><category scheme='http://www.blogger.com/atom/ns#' term='getHistoricalStockInfo'/><category scheme='http://www.blogger.com/atom/ns#' term='onOpen'/><category scheme='http://www.blogger.com/atom/ns#' term='FinanceApp'/><title type='text'>Funktion beim Öffnen einer Tabelle ausführen</title><content type='html'>Eine ziemlich geniale Option bei Google Apps Script ist es, Funktionen beim Öffnen einer Tabelle automatisch ausführen zu lassen. Dazu muss man einfach eine Funktion mit dem Namen &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;onOpen()&lt;/span&gt; erstellen. Sobald die Tabelle geöffnet wird, wird diese Funktion gestartet.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;onOpen&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// beim Öffnen ausführen...&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Als Beispiel will ich mal auf die bereits hier im Blog gezeigte Funktion zum &lt;a href="http://google-apps-script.blogspot.com/2011/01/historische-aktiendaten-mit-google-apps.html"&gt;Abrufen historischer Aktiendaten&lt;/a&gt; zurückgreifen. Es wäre doch prima, wenn automatisch die Daten der letzten 30 Tage geholt werden, sobald man die Tabelle öffnet. Dazu muss man nur die Datumsangaben für den Intervall (Start, Ende ... wobei Ende = heute und Start = heute - 30 Tage) dynamisch setzen und die Funktion durch die &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;onOpen()&lt;/span&gt;-Funktion aufrufen. Wie das im Detail dann fertig aussieht, zeigt das folgende Beispiel:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;onOpen&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;getHistoricalStockData&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;getHistoricalStockData&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;sheet&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveSheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;clear&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"A1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Datum/Uhrzeit"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"B1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Wert"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;flush&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;today&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Date&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;start&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Date&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;today&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getTime&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;-&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;30&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;*&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;24&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;*&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;60&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;*&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;60&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;*&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;1000&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;end&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;today&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;data&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;FinanceApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getHistoricalStockInfo&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"GOOG"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;start&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;end&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;1&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;for&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;0&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;data&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;stockInfo&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;length&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;++&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;row&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;2&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"A"&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;row&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;data&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;stockInfo&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;[&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;]&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;time&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"B"&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;row&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;data&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;stockInfo&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;[&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;]&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;close&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;flush&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Weitere Informationen zum automatischen und zeitgesteuerten Ausführen von Funktionen findet man in der Dokumentation zu Google Apps Script &lt;a href="http://code.google.com/googleapps/appsscript/guide_events.html"&gt;hier&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-1916152204363391372?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/1916152204363391372/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/funktion-beim-oeffnen-einer-tabelle.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/1916152204363391372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/1916152204363391372'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/funktion-beim-oeffnen-einer-tabelle.html' title='Funktion beim Öffnen einer Tabelle ausführen'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-3331040075076530122</id><published>2011-01-04T10:54:00.000+01:00</published><updated>2011-01-04T10:54:28.965+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='getAllCalendars'/><category scheme='http://www.blogger.com/atom/ns#' term='CalendarApp'/><title type='text'>Namen aller Kalender mit Google Apps Script auslesen</title><content type='html'>Das folgende Beispiel zeigt, wie man mit Google Apps Script die Namen aller Kalender im eigenen Account ausließt. Die Namen werden hierbei jeweils mit einer Message-Box ausgegeben.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;getMyCalendars&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;calendars&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;CalendarApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getAllCalendars&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;for&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;0&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;calendars&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;length&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;++&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;calendars&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;[&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;]&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getName&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-3331040075076530122?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/3331040075076530122/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/namen-aller-kalender-mit-google-apps.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/3331040075076530122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/3331040075076530122'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/namen-aller-kalender-mit-google-apps.html' title='Namen aller Kalender mit Google Apps Script auslesen'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-8034820579444271523</id><published>2011-01-04T09:42:00.002+01:00</published><updated>2011-01-04T09:44:21.621+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SpreadsheetApp'/><category scheme='http://www.blogger.com/atom/ns#' term='flush'/><title type='text'>Tabellenänderungen sofort sichtbar machen</title><content type='html'>Schreibt man mittels Google Apps Script Daten in eine Tabelle, dann werden alle Änderungen normalerweise erst am Ende der Funktion auch sichtbar. Dies kann allerdings etwas verwirrend sein, wenn innerhalb der Funktion Daten anderer Dienste abgerufen werden und dies etwas länger dauert. Man hat dann das Gefühl, das nichts passiert und etwas schief gelaufen ist. Hier ein kleines Beispiel, um dieses Verhalten zu zeigen - erst nachdem die Schleife vollständig durchlaufen wurde, werden die Zahlen in die erste Spalte der Tabelle geschrieben.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;applyChanges&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;sheet&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveSheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;for&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;1&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;10000&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;++&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"A"&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Google Apps Script bietet hier eine Methode an, um dieses Problem zu umgehen: &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_spreadsheetapp.html#flush"&gt;flush()&lt;/a&gt;&lt;/span&gt;. Beim Aufruf dieser Methode werden alle ausstehenden Änderungen sofort umgesetzt. Das  folgende Beispiel zeigt nun die um den Aufruf der &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_spreadsheetapp.html#flush"&gt;flush()&lt;/a&gt;&lt;/span&gt;-Methode erweiterte Funktion - bereits während dem Durchlaufen der Schleife werden die Zahlen in die erste Spalte der Tabelle geschrieben.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;applyChanges&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;sheet&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveSheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;for&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;1&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;10000&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;++&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"A"&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;flush&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Man sollte aber nicht zu exzessiv von der &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_spreadsheetapp.html#flush"&gt;flush()&lt;/a&gt;&lt;/span&gt;-Methode Gebrauch machen. Denn es hat einen Grund, warum standardmäßig erst alle Daten gesammelt und erst am Ende in die Tabelle geschrieben werden: &lt;b&gt;Performance&lt;/b&gt;. Jeder Aufruf von &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;getRange()&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;getValue()&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setValue()&lt;/span&gt; kostet Zeit. Werden die Aufrufe gesammelt, können sie optimiert und dann gebündelt ausgeführt werden.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-8034820579444271523?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/8034820579444271523/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/tabellenaenderungen-sofort-sichtbar.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/8034820579444271523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/8034820579444271523'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/tabellenaenderungen-sofort-sichtbar.html' title='Tabellenänderungen sofort sichtbar machen'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-487596033551721063</id><published>2011-01-04T00:08:00.003+01:00</published><updated>2011-01-04T00:13:27.809+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SpreadsheetApp'/><category scheme='http://www.blogger.com/atom/ns#' term='getHistoricalStockInfo'/><category scheme='http://www.blogger.com/atom/ns#' term='stockInfo'/><category scheme='http://www.blogger.com/atom/ns#' term='FinanceApp'/><title type='text'>Historische Aktiendaten mit Google Apps Script in Tabelle schreiben</title><content type='html'>Wie ich bereits im &lt;a href="http://google-apps-script.blogspot.com/2011/01/aktiendaten-mit-google-apps-script.html"&gt;vorherigen Artikel&lt;/a&gt; gezeigt habe, kann man mittels Google Apps Script aktuelle Daten zu Aktien abrufen. Aber auch Daten aus der Vergangenheit lassen sich sehr einfach abrufen.&lt;br /&gt;&lt;br /&gt;Das folgende Beispiel zeigt, wie man den Schlusswert der Google-Aktie für alle Börsentage im Dezember 2010 abrufen und in eine Tabelle schreiben kann.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;getHistoricalStockData&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;sheet&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveSheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;clear&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"A1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Datum/Uhrzeit"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"B1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"Wert"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;flush&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;start&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Date&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"December 1, 2010"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;end&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Date&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"December 31, 2010"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;data&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;FinanceApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getHistoricalStockInfo&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"GOOG"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;start&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;end&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;1&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;for&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;0&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;data&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;stockInfo&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;length&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;++&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;row&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;2&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"A"&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;row&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;data&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;stockInfo&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;[&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;]&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;time&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"B"&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;row&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;data&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;stockInfo&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;[&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;]&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;close&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;flush&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Die Ausgabe dieses Scripts schaut so aus:&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_SBxyG5AgEOc/TSJWz23Vn6I/AAAAAAAAFjI/Dc_ZTwWqkYw/s1600/Ausgabe.gif" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-487596033551721063?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/487596033551721063/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/historische-aktiendaten-mit-google-apps.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/487596033551721063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/487596033551721063'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/historische-aktiendaten-mit-google-apps.html' title='Historische Aktiendaten mit Google Apps Script in Tabelle schreiben'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_SBxyG5AgEOc/TSJWz23Vn6I/AAAAAAAAFjI/Dc_ZTwWqkYw/s72-c/Ausgabe.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-4734327614523477854</id><published>2011-01-03T15:23:00.005+01:00</published><updated>2011-01-04T08:44:30.480+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='getStockInfo'/><category scheme='http://www.blogger.com/atom/ns#' term='FinanceApp'/><title type='text'>Aktiendaten mit Google Apps Script abrufen</title><content type='html'>Mittels Google Apps Script kann man sehr einfach Informationen zu Aktien abrufen. Man benötigt dazu lediglich das Ticker-Symbol der gewünschten Aktie. Dieses ist zum Beispiel für Google "GOOG".&lt;br /&gt;&lt;br /&gt;Das folgende Beispiel zeigt, wie man für die Google-Aktie den vollständigen Namen (&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;name&lt;/span&gt;) der Firma und den aktuellen Preis (&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;price&lt;/span&gt;) abruft:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;getStockData&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;stockData&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;FinanceApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getStockInfo&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"GOOG"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;stockData&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;stockData&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;price&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Die Daten werden in diesem Beispiel jeweils durch eine Message-Box ausgegeben:&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_SBxyG5AgEOc/TSHdIov3YEI/AAAAAAAAFjA/_ApunxVtABA/s1600/name.gif" /&gt;&amp;nbsp;&amp;nbsp;&lt;img border="0" src="http://1.bp.blogspot.com/_SBxyG5AgEOc/TSHdKC7jrbI/AAAAAAAAFjE/OeFJy6qImVk/s1600/price.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Natürlich kann man noch wesentlich mehr Informationen abrufen. Welche das sind, kann man im entsprechenden &lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_financeresult.html"&gt;Teil der Dokumentation zu Google Apps Script&lt;/a&gt; nachschlagen.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-4734327614523477854?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/4734327614523477854/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/aktiendaten-mit-google-apps-script.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/4734327614523477854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/4734327614523477854'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/aktiendaten-mit-google-apps-script.html' title='Aktiendaten mit Google Apps Script abrufen'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_SBxyG5AgEOc/TSHdIov3YEI/AAAAAAAAFjA/_ApunxVtABA/s72-c/name.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-5713879320447998174</id><published>2011-01-03T14:14:00.004+01:00</published><updated>2011-01-04T08:44:22.644+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sendEmail'/><category scheme='http://www.blogger.com/atom/ns#' term='MailApp'/><title type='text'>E-Mails mit Google Apps Script versenden</title><content type='html'>Das folgende einfache Beispiel zeigt, wie man mit Google Apps Script eine E-Mail versenden kann:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #770088; font-family: monospace; font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="white-space: nowrap;"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-size: 13px;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;emailExample&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;MailApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;sendEmail&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;'max@mustermann.de'&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;'Das ist der Betreff'&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;'Das ist der Text.'&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Die Funktion &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;sendEmail()&lt;/span&gt; erlaubt es zusätzlich, &lt;a href="http://code.google.com/intl/en/googleapps/appsscript/class_mailapp.html#sendEmail"&gt;weitere Parameter&lt;/a&gt; anzugeben, um zum Beispiel den Namen des Absenders zu definieren (siehe nächstes Code-Beispiel). Standardmäßig wird hier nämlich nur die E-Mail-Adresse des Absenders eingesetzt.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #770088; font-family: monospace; font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="white-space: nowrap;"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-size: 13px;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;emailExample&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;MailApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;sendEmail&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;'max@mustermann.de'&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;'Das ist der Betreff'&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;'Das ist der Text.'&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;'name'&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;:&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;'Max Mustermann'&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-5713879320447998174?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/5713879320447998174/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/e-mails-mit-google-apps-script.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/5713879320447998174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/5713879320447998174'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2011/01/e-mails-mit-google-apps-script.html' title='E-Mails mit Google Apps Script versenden'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-1997176357565244359</id><published>2010-12-23T15:25:00.024+01:00</published><updated>2011-01-04T08:44:12.886+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UrlFetchApp'/><category scheme='http://www.blogger.com/atom/ns#' term='fetch'/><category scheme='http://www.blogger.com/atom/ns#' term='getResponseCode'/><title type='text'>Response-Code für einen URL abfragen</title><content type='html'>Wenn man mittels Google Apps Script den Response-Code für einen bestimmten URL abfragen möchte muss man beachten, dass dies nur für 2xx-Codes funktioniert. Das Problem ist nämlich, dass &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;UrlFetchApp.fetch()&lt;/span&gt; nur für diesen Bereich richtig funktioniert. Ist der Server zum Beispiel nicht verfügbar oder der URL ist mit einer Zugriffssperre geschützt, verursacht &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;UrlFetchApp.fetch()&lt;/span&gt; eine JavaException.&lt;br /&gt;&lt;br /&gt;Evin Levey, ein Google-Angestellter meint dazu: "&lt;i&gt;This is actually 'by design', and it's a bit of an ugly design.&lt;/i&gt;" Ich würde das allerdings als ernsthaften Bug bezeichnen.&lt;br /&gt;&lt;br /&gt;Um es selbst auszuprobieren, kann man folgende Funktion nutzen:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;checkUrl&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Dieser URL funktioniert.&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;url&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"http://www.google.com"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Dieser URL funktioniert nicht.&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;//&amp;nbsp;"JavaException: Request failed for http://www.google.com/abc returned code 404."&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;//var url = "http://www.google.com/abc";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;try&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Nur wenn der Response-Code innerhaöb des 2xx-Bereichs liegt.&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Das ist ein Bug in Google Apps Script.&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;response&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;UrlFetchApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;fetch&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;url&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;responseCode&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;response&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getResponseCode&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;responseCode&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;catch&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;e&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;e&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Um das Problem zu umgehen, nutzt man am besten die aus JavaScript bekannte &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;try/catch&lt;/span&gt; Syntax. Innerhalb des &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;catch&lt;/span&gt;-Teils kann man dann mit einem kleinen regulären Ausdruck den Response-Code aus der JavaException extrahieren.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;checkUrl&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Dieser URL funktioniert.&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;//var url = "http://www.google.com";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Dieser URL funktioniert nicht.&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// "JavaException: Request failed for http://www.google.com/abc returned code 404."&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;url&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"http://www.google.com/abc"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;try&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Nur wenn der Response-Code innerhaöb des 2xx-Bereichs liegt.&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Das ist ein Bug in Google Apps Script.&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;response&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;UrlFetchApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;fetch&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;url&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;responseCode&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;response&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getResponseCode&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;responseCode&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;catch&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;e&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;regex&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;/code\s(\d*)\./g&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;regex&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;exec&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;e&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;RegExp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;$1&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-1997176357565244359?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/1997176357565244359/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2010/12/response-code-fuer-einen-url-abfragen.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/1997176357565244359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/1997176357565244359'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2010/12/response-code-fuer-einen-url-abfragen.html' title='Response-Code für einen URL abfragen'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-1013851348429373391</id><published>2010-12-23T12:07:00.008+01:00</published><updated>2011-01-04T08:43:38.936+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ContactsApp'/><category scheme='http://www.blogger.com/atom/ns#' term='SpreadsheetApp'/><category scheme='http://www.blogger.com/atom/ns#' term='getContactGroups'/><title type='text'>Kontakt-Gruppen in eine Tabelle schreiben</title><content type='html'>Das folgende Beispiel zeigt, wie man mit Google Apps Script Kontakt-Gruppen in eine Tabelle schreibt.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;writeContactGroupNamesToSpreadsheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// alle Gruppen abrufen&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;groups&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;ContactsApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getContactGroups&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// aktuelle Tabelle ermitteln&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;sheet&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getActiveSheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Zelle in der aktuelle Tabelle definieren&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;range&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"A1"&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Spaltentitel schreiben&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;range&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;'Group names'&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Gruppennamen in die Tabelle schreiben&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;for&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;0&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;groups&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;length&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;++&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Name der aktuellen Gruppe ermitteln&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;groups&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;[&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;]&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getName&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Zelle in der Tabelle definieren&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;range&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;sheet&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getRange&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;"A"&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;String&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;i&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;+&lt;/span&gt;&lt;span class="js-atom" style="color: #228811;"&gt;2&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-comment" style="color: #aa7700;"&gt;// Gruppenname in die definierte Zelle der Tabelle schreiben&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;range&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;setValue&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-1013851348429373391?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/1013851348429373391/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2010/12/kontakt-gruppen-in-eine-tabelle.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/1013851348429373391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/1013851348429373391'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2010/12/kontakt-gruppen-in-eine-tabelle.html' title='Kontakt-Gruppen in eine Tabelle schreiben'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576799719977527868.post-8039373710925871205</id><published>2010-12-23T10:16:00.012+01:00</published><updated>2011-01-04T08:43:09.078+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ContactsApp'/><category scheme='http://www.blogger.com/atom/ns#' term='getContactGroups'/><title type='text'>Namen der Kontakt-Gruppen auslesen</title><content type='html'>Das folgende Beispiel zeigt, wie man mit Google Apps Script die Namen der Kontakt-Gruppen ausließt.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myContactGroups&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;groups&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;ContactsApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getContactGroups&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;for&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;in&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;groups&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;group&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;groups&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;[&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;]&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;group&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getName&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Es existieren einige Standard-Gruppen: "My Contacts", "Friends", "Family" und "Coworkers"), die alle den Präfix "System Group: " im Namen tragen. Um diesen Präfix zu entfernen kann man einen regulären Ausdruck verwenden, wie es die folgende etwas erweiterte Funktion zeigt.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: monospace; font-size: 13px; white-space: nowrap;"&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;function&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;myContactGroups&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;groups&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;ContactsApp&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getContactGroups&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;for&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;i&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;in&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;groups&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;group&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;groups&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;[&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;i&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;]&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-keyword" style="color: #770088;"&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class="js-variabledef" style="color: blue;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;group&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;getName&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;name&amp;nbsp;&lt;/span&gt;&lt;span class="js-operator" style="color: #666666;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;replace&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;'System Group: '&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="js-string" style="color: #aa2222;"&gt;''&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;Browser&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;.&lt;/span&gt;&lt;span class="js-property" style="color: black;"&gt;msgBox&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;(&lt;/span&gt;&lt;span class="js-localvariable" style="color: #004499;"&gt;name&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;)&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="whitespace"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="js-punctuation" style="color: #666666;"&gt;}&lt;/span&gt;&lt;span class="js-variable" style="color: black;"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576799719977527868-8039373710925871205?l=google-apps-script.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://google-apps-script.blogspot.com/feeds/8039373710925871205/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://google-apps-script.blogspot.com/2010/12/namen-der-kontakt-gruppen-auslesen.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/8039373710925871205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576799719977527868/posts/default/8039373710925871205'/><link rel='alternate' type='text/html' href='http://google-apps-script.blogspot.com/2010/12/namen-der-kontakt-gruppen-auslesen.html' title='Namen der Kontakt-Gruppen auslesen'/><author><name>Dirk Einecke</name><uri>http://www.blogger.com/profile/06112052517869095284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://photos1.blogger.com/x/blogger2/7039/729299898556885/184/z/55858/gse_multipart57289.jpg'/></author><thr:total>0</thr:total></entry></feed>
