Go to Mars with MAVEN!
Submit your name and a message to be sent into Mars orbit on the MAVEN spacecraft.
Minds are like parachutes. They only function when they are open.
1: function doGet() {
2: var app = UiApp.createApplication();
3: //create a penel which will hold all the elements
4: var panel = app.createVerticalPanel();
5: var label1 = app.createLabel('Write the text to translate');
6: //Create text area which will hold the source text
7: var textArea1 = app.createTextArea().setId('originText').setName('originText').setWidth('300').setHeight('100');
8: textArea1.setText('Roma รจ la capitale d\'Italia');
9: //Create a button
10: var button = app.createButton('Translate');
11: var label2 = app.createLabel('Taranslated text:');
12: //Create text area which will hold translated text
13: var textArea2 = app.createTextArea().setId('destitinationText').setWidth('300').setHeight('100');
14: //Create a click handler which will call the translate function
15: var handler = app.createServerClickHandler('translate');
16: handler.addCallbackElement(textArea1); // This row is important
17: button.addClickHandler(handler);
18: //add all the elemnts to the panel
19: panel.add(label1).add(textArea1).add(button).add(label2).add(textArea2);
20: //Add the panel to the application
21: app.add(panel);
22: return app;
23: }
24: function translate(e){
25: //Get the current activae application
26: var app = UiApp.getActiveApplication();
27: //get the source text of TextArea1
28: var text = e.parameter.originText;
29: //Now translate the text
30: var translatedText = LanguageApp.translate(text, 'it', 'en');
31: //set the text of text area 2 as the translated text
32: app.getElementById('destitinationText').setText(translatedText);
33: return app;
34: }
function myFunction() {
// Create a new document
var doc = DocumentApp.create('MyContactsList');
//loop all contacts and put them inside the document
var contacts = ContactsApp.getContacts();
for (var i=0; i<contacts.length; i++)
{
if ( contacts[i].getFullName() != '' )
{
try
{
doc.appendParagraph(contacts[i].getFullName() + ' ' +
contacts[i].getEmails()[0].getAddress() );
}
catch(e)
{
doc.appendParagraph(contacts[i].getFullName() + ' without email' );
}
}
}
// Save and close the document
doc.saveAndClose();
// Get the URL of the document
var url = doc.getUrl();
// Get the email address of the active user - that's you
var emailAddress = Session.getActiveUser().getEmail();
GmailApp.sendEmail(emailAddress,'Your contact list',
'The document filled with your contacts is here: ' + url);
}