HomeTaskerTasker Project - Clipboard Manager

Tasker Project – Clipboard Manager

How to create Tasker - Clipboard Manager Project

If you want to know how the clipboard manager works,  go and check my previous showcase. It will show you the video and general information about the Tasker Project – Clipboard Manager. As usual, we are going to go through each part of the project and I will explain how it works. Let’s start.

Tasker Project – Clipboard Manager

For this project, I’m using AutoTools WebScreens action so make sure you have the plugin installed.  Anything else is just stock Tasker. Access to the clipboard manager is driven by the apps. I don’t need this when I’m watching YouTube or playing a game, therefore, there is a profile that enables the swipe functionality.

PROFILE – Apps with Clipboard

In this example, I’m using Google+ and Pages Manager to enable the WebScreens swipe.

TASKER PROFILE - Apps with Clipboard
Profile: Apps With Clipboard 
	Restore: no
	Application: Google+ or Pages Manager
Enter: Launch Menu 
	A1: AutoTools Web Screen [ Configuration:Screen Preset: Swipe
		Display Mode: Overlay
		Close Overlay ID: Swipe
		Source: /storage/emulated/0/AutoTools/swipe/page.html
		Toast Duration: 5000
		Background Color: #00CE93D8
		Width: 10
		Height: 400
		Gravity: Bottom Right
		Animation: Slide In From Bottom
		Overlay Id: Swipe
		Show Duration: 500
		Hide Duration: 250
		Drag: Not Draggable
		Hide Dialog Shadow: true
		Inject In Header: var a=1;
		Commands Prefix: swipe
		Swipe Left: left
		Swipe Right: right
		Swipe Up: up
		Swipe Down: down
		Border Color: #AB47BC
		Border Witdh: 3
		Border Side: Right Timeout (Seconds):30 ] 

Exit: Exit Clip Gesture
	A1: AutoTools Web Screen [ Configuration:Screen Preset: Swipe
		Display Mode: Close
		Close Overlay ID: Swipe
		Source: /storage/emulated/0/AutoTools/swipe/page.html
		Toast Duration: 5000
		Background Color: #00CE93D8
		Width: 10
		Height: 400
		Gravity: Bottom Right
		Animation: Slide In From Bottom
		Show Duration: 500
		Hide Duration: 250
		Drag: Not Draggable
		Hide Dialog Shadow: true
		Inject In Header: var a=1;
		Commands Prefix: swipe
		Swipe Left: left
		Swipe Right: right
		Swipe Up: up
		Swipe Down: down
		Border Color: #AB47BC
		Border Witdh: 3
		Border Side: Right Timeout (Seconds):30 ] 

Select the applications you want to enable in the context, then create a Task called Launch Menu. This task will enable the WebScreen swipe in the Tasker Project – Clipboard manager.

TASK – Launch Menu

In the AutoTools WebScreen option import a Screen preset (swipe) and remove all commands but ‘left’ in the commands section of the setup page.

Set up Windows settings to your preference. I have the Gravity set to Bottom Right, Width is 10 and Height are ‘fill’.

TASK – Exit Clip Gesture

We need to disable the gesture when it’s not needed. Add an exit task and create another WebScreens action. This time use the Display Mode to set ‘close’ action. This will terminate the WebScreen and swipe recognition.

PROFILE – Show Menu

By default swiping right will issue an AutoTools Command swipe=:=right. When this happens, I want my clipboard manager to open. Create the AutoApps context with ‘swipe’ as a filter. When the swipe is done, a nice menu will appear with all the clips we need.

TASKER PROFILE - Show Menu
Profile: Show Menu 
	Event: AutoApps Command [ Configuration:Command Filter: swipe ]
Enter: Clipboard Menu 
	A1: AutoTools Web Screen [ Configuration:Screen Preset: Card List
		Display Mode: Dialog
		Source: /storage/emulated/0/AutoTools/cardlist/page.html
		Toast Duration: 5000
		Width: 100
		Height: fill
		Gravity: Bottom Right
		Animation: Slide In From Top
		Show Duration: 500
		Hide Duration: 250
		Close On Command: true
		Wait For Command: true
		Title: Clip
		Card Titles: %ClipPosition()
		Card Subtext Left: %ClipAbrev()
		Card Commands: %ClipPosition()
		Commands Prefix: clipboard
		Background Color: #BDBDBD
		Accent Color: #F9A825
		Max Card Width: 90%
		Max Image Height: 75
		Title Text Size: 5
		Card Padding: 0
		Card Alignment: Center
		Item Separator: , Timeout (Seconds):30 ] 

TASK – Clipboard Menu

The layout has been ‘borrowed’ from Joao’s tutorial. I liked how the side launcher looked and there was no point of reinventing the wheel again. Obviously, the variables used in that WebScreen will be different but the layout is pretty much the same.

Add an AutoTools Web Screen action and select the Card List preset, Under Window Settings set

  • Width to 100
  • Height to fill
  • Gravity to Bottom Right

Under Command Options enable both Close On Command and Wait For Command, Under Cards set

  • Card Titles to %ClipPosition() (will contain numbers from 1-9)
  • Card Subtexts to %ClipAbrev() (contains short snippet)
  • Card Commands to %ClipPosition() (used to identify the press)
  • Commands prefix to clipboard
  • Max Card Width and Min Card Width to 90%
  • Max Image Height to 75
  • Title Text Size to 5

Feel free to modify the look of the notification. Bear in mind that opening the WebScreen without the next step won’t give you any previews.

TASK – array numbers

We need an array that will contain the numbers from 1-9. These will be used to identify our clipboard entries and will be stored in %ClipPosition() array.

TASK - array numbers
array numbers
	A1: Variable Set [ Name:%ClipPosition To:1.2.3.4.5.6.7.8.9 
            Recurse Variables:Off Do Maths:Off Append:Off ] 
	A2: Variable Split [ Name:%ClipPosition Splitter:. Delete Base:Off ] 

Create this task then generate the array. This will create the global array.

PROFILE – Clipboard Monitor

This profile will monitor changes in the %CLIP system variable that contains the current clipboard. Use Event trigger – variable set and set it to %CLIP. When a new clipboard has been set, Tasker will detect the changes.

PROFILE - Clipboard Monitor
Profile: Clipboard Monitor 
	Event: Variable Set [ Variable:%CLIP Value:* User Variables Only:Off ]
Enter: Clipboard Manager 
	A1: Variable Section [ Name:%CLIP From:1 Length:6 Adapt To Fit:On Store Result In:%abrev ] 
	A2: Array Push [ Variable Array:%ClipboardArray Position:1 Value:%CLIP Fill Spaces:Off ] 
	A3: Array Push [ Variable Array:%ClipAbrev Position:1 Value:%abrev Fill Spaces:On ] 
	A4: Array Process [ Variable Array:%ClipAbrev Type:Remove Duplicates ] 
	A5: Array Process [ Variable Array:%ClipboardArray Type:Remove Duplicates ] 
	A6: Array Process [ Variable Array:%ClipboardArray Type:Squash ] 
	A7: Array Process [ Variable Array:%ClipAbrev Type:Squash ] 
	A8: Array Pop [ Variable Array:%ClipAbrev Position:10 To Var: ] If [ %ClipAbrev(#) eq 10 ]
	A9: Array Pop [ Variable Array:%ClipboardArray Position:10 To Var: ] If [ %ClipboardArray(#) eq 10 ]

;

TASK – Clipboard Manager

Our clipboard content is stored in the %ClipboardArray() – each time a new clipboard is saved an Array Push (A2) action moves it to the 1st position of the array.  Because I don’t want an entire text to be visible on the side menu, I created another array %ClipAbrev() (A3) that will store first X letters of the clipboard. To shorten the clipboard use (A1) Variable Selection and limit numbers of characters to ie 6 (make sure that Adapt to Fit is checked) store that value in the local %abrev variable which is used to populate the (A3) Array Push action.

Now that we have the clipboard collection ready we have to clean up the mess. The array will collect all the clipboards. This means that when we pick a clipboard from our side menu, it will collect the new value and assign it as a duplicate to the menu. Therefore each time we save a clipboard – I want to remove duplicate entries (A4,A5) and remove empty spaces (A6,A7).  Array process actions are performed on both %Clipboard Array() and %ClipAbrev.

Lastly, I want my menu to contain 9 entries only. You can have more, but I find that the 9 menus fit great on my screen without scrolling. To do this – use Array Pop (A8,A9) and remove the 10th position. Do this ONLY if the array contains 10 elements. Otherwise, the last element is removed. We achieve this by checking if number of elements %ClipboardArray(#) = 10.

PROFILE – Set Clipboard

We are nearly done. This is a very simple profile. We are using AutoApps command clipboard to check if the command has been received. The command will look like this: clipboard=:=1 where the number stands for the button pressed on our side menu.

PROFILE - Set Clipboard
Profile: Set Clipboard 
	Event: AutoApps Command [ Configuration:Command Filter: clipboard ]
Enter: Set New Clip 
	A1: Set Clipboard [ Text:%ClipboardArray(%aacomm) Add:Off ] 

TASK – Set New Clip

The task is very simple as well. Set clipboard to the value of the %ClipboardArray() we want to choose the element specified by the %aacomm part of the received command. So set clipboard as %ClipboardArray(%aacomm). And you are done. The Tasker Project – Clipboard Manager is completed.

Conclusion

What I like most about the Tasker Project – Clipboard Manager is that at no point it obscures your screen. I find the bubbles annoying. There is a Tasker project file for you to download and use. Consider supporting my website, follow me on social media. It matters to us creators a lot.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

New to Tasker?

Tasker Quick Start – Getting started with Tasker

0
From newb to not so newbie in 10 min

Best Tasker Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

How to wake on LAN computers and put it to sleep with Power Menu,...

0
How to Wake on LAN properly via Android, Alexa, Google Assistant and Web

7 awesome Bluetooth keyboard shortcuts for Android

0
7 unique Android shortcuts that you can add to any Bluetooth keyboard.

Smart overnight charging with Tasker

0
Still keeping your phone plugged in overnight? Try smarter overnight charging with this profile

One thing that Join app can’t do and how to fix it with Tasker

0
It's not possible to share the clipboard automatically between join accounts registered to 2 different emails. But you can fix this with tasker.

Essential Guides

Tasker: Seconds into DD:HH:MM:SS (dynamic)

0
It's time to.... ok it's a pun, but I will show you how to master time and convert seconds to DD:HH:MM:SS dynamically

4 ways to organise Tasker projects

0
Keep your Tasker tidy!

A better way to store Tasker credentials

0
The more clever way of managing credentials

Annoyed with dozens of AutoApps populating your app drawer? Here is a fix!

0
Clear your app drawer from the clutter in seconds

Putting AutoTools pie chart to a good use – SSID logger

0
Who wants a piece of the pie (chart)?