New Google Drive integrations in Tasker

Google Drive support is finally fully fleshed out!

Over the last couple of weeks, you could see Google Drive making its way to Tasker. The brand new update introduces a new Google Drive integrations in Tasker. What’s new and how to use it?

Google Drive integrations in Tasker

The video shows you the basic concept. Tasker now is capable of checking Google Drive folders across the devices. Previously, only backup, then pushing files to Google Drive were possible. Now with the new Google Drive integrations in Tasker, you can monitor changes periodically in selected folders and synchronise it.

Thanks to the changes the Google Drive integrations in Tasker let you upload, delete and monitor the files across the devices and folders. You can also browse the files, folders within Tasker too!

Previously, the similar level of synch could be achieved with plugins like FolderSync, looks like Tasker will support the Google Drive natively, but if you still want to use other services like DropBox, Amazon and FTP, FolderSync is your best bet.

FolderSync Pro
Price: $2.99

My Showcase: Backup Screenshots to another Google Account

I have two Google accounts: private and one associated with NotEnoughTech. Google Photos can sync up screenshots to a separate album but does it to the wrong Google account. I’d like to keep my pictures synced with the personal account, but screenshots send automatically to Google Drive associated with NotEnoughTech.

Let’s do this, and let’s get a small notification when this is completed send to my computer. I know you could simply send the files over Join or AutoRemote to the target device, but I would be using the same account and the purpose of this tutorial is to show you how the syncing works.

Set Google Account

TASKER TASK: Set Google Account
SS Set Google Account
    A1: GD Sign In [  Google Drive Account: Full Access:On ] 
    A2: Variable Set [ Name:%SSGOOGLEACCOUNT 
        To:%gd_account 
        Recurse Variables:Off Do Maths:Off Append:Off ]     

First, we have to pick the account, authorise the access and store the account details in a Global variable. If you want to pick an account every time, run this task before screenshot upload.

This has to be run once. If you wish to change the account later, you can run the task again to register a new account.

Upload File

TASKER TASK: Upload File
SS Upload File 
    A1: Flash [ Text:Uploading screenshot Long:Off ] 
    A2: GD Upload [  Google Drive Account:%SSGOOGLEACCOUNT 
	Data / File:%par1 
	Remote File Name: 
	Remote Folder:Pixel/Screenshot 
	Content Description:All screenshots from Pixel 
	Overwrite If Exists:On 
	Publicly Share File:Off 
	Continue Task After Error:On ] 
    A3: Flash [ Text:Upload comple Long:Off ] 
    A4: Join Send Push [ Configuration:Device: Desktop
	Text: Your Screenshot is available
	Title: New File
	Icon: ICONS/ic_file_download_black_48dp.png 
	Timeout (Seconds):60 ]     

Time to upload the file. I know I’m going to run this task from another one. This means that the file path will be stored as %par1. Use the global variable containing the Google account credentials and push the files to the folder on your Google Drive.

I have added toast confirmations and a Join message that is displayed on the computer to let me know that the file has been uploaded successfully.

Monitor Changes

TASKER PROFILE: Monitor Screenshot Folder
Profile: SS Monitor Screenshot Folder 
    Event: File Attribute Change [ File:Pictures/Screenshots/ ]
Enter: SS Monitor Changes 
    A1: List Files [ Dir:Pictures/Screenshots 
	Match: Include Hidden Files:Off 
	Use Root:Off 
	Sort Select:Modification Date, Reverse 
	Variable:%files ] 
    A2: Perform Task [ Name:SS Upload File 
	Priority:%priority 
	Parameter 1 (%par1):%files1 
	Parameter 2 (%par2): 	
	Return Value 
	Variable: Stop:Off ] 

Create an event profile which will monitor the File Attribute Change. Whenever the content of the Screenshot folder changes, I will list all the files according to the modification date (reverse) and push the 1st position as %par1.

This will be the latest file created inside this folder – my last screenshot. This file will get uploaded to Google Drive.

Screenshots on PC

I used Backup & Sync software provided by Google, to sync my local files with Google Drive account. Whatever I’m uploading to Google Drive will appear after a couple of seconds on my computer (all of them). The same files will be accessible via GDrive web interface.

Conclusion

I’m super excited as I use the Google Drive for pretty much all my online storage. Having Tasker support enables new options like notifications when a file has been uploaded, automatic actions and more. Tell me your plans for the new Google Drive integrations in Tasker. I’m curious to hear what will you come up with!

Support NotEnoughTech
A lot of time and effort goes into keeping NotEnoughTech alive! If my work helped you out, consider buying me a coffee or check out exclusive rewards available to Patreon supporters.
SHARE