Google Apps Script

Hi Friends..!!

Today we will take a look on Google Apps Script. It seems to be something new for the people who are in the burgeoning stage of learning new things in technology but it could be possible for some to be familiar with this.

As Google provide us various applications, languages, content etc. in the same way now it is providing us Google App Script. The name is depicting itself that it is related to scripting. Well yes…!! Google provide us a cloud based scripting language that offer us alter easy ways to automate tasks across Google products.

It can be explained in simple words as-

Google App Script make it easy to create and publish various add-ons in online store of Google Sheets, Docs and Forms. 

Here, the question arises that what are add-ons? Add-ons can be simply defined as adding extra features to Google Docs, Google Sheets etc.

Google Apps Script is mainly based on JAVA Script and instead of running on the client side it runs on the Google Cloud. This could be its main feature.

HOW TO WRITE YOUR FIRST APPS SCRIPT?

The following steps and links will help you to write your first script-

  • Firstly, click on the link provided below: (but before clicking on this link you will need to sign in from your google account. )

script.google.com

  • After that you will be redirected to a page that will introduce apps scripting. ( only if this is your first time) Proceed further by clicking on the Start Scripting button.

  • Now a welcome screen will be there in-front of you and you have to choose the kind of script you want to make. click on blank project or close.
  • On the script editor delete the code written on it and just paste the code given below-

function createAndSendDocument() {

//To Create a new Google Doc named ‘Hello, world!’

var doc = DocumentApp.create(‘Hello, world!’);

// To Access the body of the document, then add a paragraph.

doc.getBody().appendParagraph(‘This document was created by Google Apps Script.’);

// To Get the URL of the document.

var url = doc.getUrl();

// To Get the email address of the active user – that’s you.

var email = Session.getActiveUser().getEmail();

// To Get the name of the document to use as an email subject line.

var subject = doc.getName();

// To Append a new string to the “url” variable to use as an email body.

var body = ‘Link to your doc: ‘ + url;

// To Send yourself an email with a link to the document.

GmailApp.sendEmail(email, subject, body);

}

  • Next, you have to enter the project name and then click on OK.

HOW TO RUN YOUR FIRST SCRIPT?

Follow these following steps to run your first script:

  • To run your first script either click on the run option shown below in the image or either choose the run option from the menu bar.
  • After that you will see a dialog box that will look like this-

  • Click on the Continue option. Now you will see an another dialog box that will be as follows-

  • Click on Allow after reading the notice carefully.
  • Now you will be redirected to your script editor and you will see a yellow bar (appears for very short time), it means your script is running.
  • Now check your Email and click on the link .
  • Now open your Google drive and you will find both the script and the document stored there.

Hope this will help you to write your first script. At last I could say that there are many feature that Google Apps Script is offering to us these are-

 DOLES OF GOOGLE APPS SCRIPT
  • It is mainly based on JAVA Script. So, easy to learn.
  • There is no need to install any thing to begin the development.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s