How to send SMS messages to save web pages to Google Drive
IT Tricks

How to send SMS messages to save web pages to Google Drive


Here’s a quick way to save an article or a web page. Just send the SMS to yourself and save the web page as a PDF file to your Google Drive account to read later.

Right now, you can set up this convenient automation in just a few steps! Let’s find out right now!

How to send an SMS to save a web page to Google Drive

  • Step 1: Send SMS to Google Sheets using IFTTT
  • Step 2: Save the URL to Google Drive
  • Step 3: Activate the script on the sheet update
  • Step 4: Run your script test

Step 1: Send SMS to Google Sheets using IFTTT

You don’t have to subscribe to any paid services to save pages and read offline. The first step is to set up automation so you can send SMS to Google Sheets. You will do this by activating an IFTTT applet.

First go to IFTTT (create an IFTTT account if you don’t already have one), click My Applets, and then New Applet.

New Applet

Click This, then type SMS in the search field.

Choose SMS.

Choose Send IFTTT an SMS tagged.

#savepage

Next, enter #savepage go to school Tag.

This tells IFTTT to activate the applet any time you send IFTTT an SMS, and that uses the #savepage tag in the message.

Don’t worry about the phone number to send the message, you will get that number after the process.

IFTTT

You are about to complete this step. Click Create trigger, Then on the next page, click That.

This step will take you to the search page Action.

Write a new field in Google spreadsheet to store the URL of the website you want to save.

Search “Sheets” and choose Sheets action.

Sheets Action

On the next page, you will choose Update cell in spreadsheet.

This tells IFTTT that every time you send an SMS that starts with #savepage, you’ll want IFTTT to update a specific cell in the spreadsheet with your Google Drive account.

Updates a specific cell

The next page is where you set up the specifics for this action.

Set up the fields on the next page as follows.

  • Drive folder path: IFTTT / SMS
  • Spreadsheet name: Article Warehouse
  • Which cell: A2
  • Value: {{Message}}

Before you click Create, Go to your Google Drive account, create an IFTTT / SMS folder and create a spreadsheet to hold the URLs you will send.

The spreadsheet will look like this:

The spreadsheet will look like this

Name the spreadsheet exactly the same name you specified in the field Spreadsheet name.

As you can see, cell A2 is blank and ready to receive the URL value you are about to send to IFTTT via SMS.

Now, back to IFTTT, click Create.

Note down the phone number you need to send SMS to to save the web pages you want to read later.

Step 2: Save the URL to Google Drive

Now, you have a system that automatically sends SMS the URLs you want to save to Google Sheet.

Next, you will need to create a Google Script to convert that URL into a PDF file and save it in the folder “MyArticles” in your Google Drive account. Don’t worry, the script has already been written for you and it’s very simple.

But first, create a new folder in your Google Drive account called “MyArticles”. Right click on it and select Get shareable link.

Get shareable link

Paste it into the notepad and set it aside. You will need this special ID later.

Now, let’s go back to the named Google Sheet page Article Warehouse that you created above.

To create a new Google Script, click Tools and then click Script editor. Rename this project SaveURL. Then paste the following script into Code.gs:

function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Sheet1');
var range = sheet.getRange(2,1);
var data = range.getValue();
var URLtext = data.substring(10,data.length)
var response = UrlFetchApp.fetch(URLtext);
var htmlBody = response.getContentText();
var blob = Utilities.newBlob(htmlBody, 'text/html').getAs('application/pdf').setName(Date() + '_MyArticle.pdf');
var folder = DriveApp.getFolderById("<type your folder ID here>")
var file = folder.createFile(blob);
}

Here’s how this script works step by step:

1. Drag the URL stored in cell A2 (this is what “getRange (2.1)” does).

2. Take the first 10 characters, plus “#savepage”, from the URL string.

3. Fetch web pages from the Internet.

4. Convert web page to PDF format.

5. Save the PDF file to the drive you specified.

In the script, replace ““equal to the ID of the folder in the notepad file you saved above.

Save the script

Save this script by clicking the save drive icon.

Step 3: Activate the script on the sheet update

You want your script to run each time the spreadsheet changes, and a change in the spreadsheet means you’ve sent a new SMS containing a URL to save.

To do this, in windows Script Editor, click Edit and then click Current project’s triggers.

Script Editor

You will see that there are no triggers present for this project.

Click the blue link Click here to add one now.

Add a trigger

Configure triggers by setting “Run” Fort myFunction and “Events” Fort From spreadsheet and On change.

Now your entire project is complete and ready to go!

Step 4: Run your script test

On your mobile phone, send SMS to the phone number you indicated above. Guarantee included “#savepage” in front of the URL.

Just copy the URL from your mobile browser window and paste it in the SMS.

Copy the URL from the browser window

Next, check to make sure IFTTT is working properly.

Access your IFTTT account, click Applet you created for this project and checked when it last ran.

Click on the Applet created

If everything is working properly, the last time it runs will be closer to the current time.

Once you’ve confirmed that your IFTTT app is working, next go to your Google Drive account and check the folder you created for your post.

You should see a new PDF appear in the last few minutes.

New PDF file appears

Open the PDF file and make sure it has saved the correct web page.

You will notice that the images from the page are not included in the PDF version.

Photos are removed

In fact, removing images is very helpful and there are a couple of reasons for this.

It greatly reduces the size of PDF files stored in the drive. It also allows you to focus on saving the text you want to read later, and it makes future skimming less distracting.

This is a very effective way to quickly save academic material on the web, news stories you want to read later, or any other online text you want.

This is just one example. There are many other examples of how you can increase your productivity with Google Scripts.

Good luck!

See more:

  • How to backup SMS by SMS Backup and Restore
  • How to backup and restore Zalo messages on Android phones
  • 7 things you can do with your email inbox without your knowledge

.

Leave a Reply

Your email address will not be published. Required fields are marked *