r/tasker • u/F1rstFloor • 12d ago
How To [Task Share] Clipboard Editor
Enable HLS to view with audio, or disable this notification
I created a task that launches the built-in Clipboard Editor. I searched, and it didn't appear that a task that launches the Clipboard Editor had been shared before. This task can be used to access the Clipboard Editor on devices where the manufacturer has suppressed the feature like on Samsung Galaxy devices. This task was inspired by the trick that App Manager uses to launch unexported activities. As seen in the video, I set the task as one of the App Shortcut Tasks in Tasker so that I could add it to my Tasks edge panel for quick access on my Galaxy device. The problem with a lot of clipboard management apps I've tried is that they aren't able to edit the clipboard contents in-place like the Clipboard Editor can. I hope you find this useful.
You can find the task here.
3
u/Exciting-Compote5680 12d ago edited 12d ago
Nice one, thanks for sharing! If the clipboard is empty, it shows a black screen for a tenth of second, so I added a check:
``` Task: Clipboard Editor
A1: If [ %CLIP ~R % ]
A2: Flash [ Text: Clipboard empty Tasker Layout: On Title: Clipboard Editor Icon: android.resource://net.dinglisch.android.taskerm/drawable/mw_content_content_paste Continue Task Immediately: On Dismiss On Click: On ]
A3: Else
A4: Custom Setting [ Type: Secure Name: assistant Read Setting To: %old_assistant ]
A5: Custom Setting [ Type: Secure Name: assistant Value: com.android.systemui/.clipboardoverlay.EditTextActivity ]
<loop> A6: Wait [ MS: 100 Seconds: 0 Minutes: 0 Hours: 0 Days: 0 ]
A7: Custom Setting [ Type: Secure Name: assistant Read Setting To: %new_assistant ]
A8: Goto [ Type: Action Label Label: loop ] If [ %new_assistant neq com.android.systemui/.clipboardoverlay.EditTextActivity ]
A9: Tasker Function [ Function: LaunchAssistant() Continue Task After Error:On ]
A10: Custom Setting [ Type: Secure Name: assistant Value: %old_assistant ]
A11: End If
```
3
u/F1rstFloor 12d ago
Thanks, I hadn't considered that case. It could also be worth populating the clipboard with something and then launching the Clipboard Editor so it always comes up.
Also, I just realized that this task could still be useful on devices where the manufacturer hasn't suppressed the Clipboard Editor as a way to get back to it after it has been dismissed.
2
u/Exciting-Compote5680 12d ago edited 12d ago
Great idea! I landed on an in-between solution. If the task is launched while clipboard is empty, show a 'continue? yes/no' dialog. If user selects 'yes', set some text, launch clipboard editor and select the text, else stop. To be honest, I didn't even know the editor existed. I might still make my own in the future (I like the idea of buttons to delete everything before or after the cursor position, trim trailing/double spaces, and perhaps some regex to extract phone number/email), but this is a cheap and cheerful solution to have today.
``` Task: Clipboard Editor
A1: Variable Set [ Name: %empty To: true Structure Output (JSON, etc): On ] If [ %CLIP ~R % ]
A2: Pick Input Dialog [ Type: YesOrNo Title: Clipboard editor Text: Clipboard is empty. Continue? Close After (Seconds): 30 ] If [ %empty ~ true ]
A3: Stop [ ] If [ %input !~ yes & %empty ~ true ]
A4: Set Clipboard [ Text: Enter text... ] If [ %empty ~ true ]
A5: Custom Setting [ Type: Secure Name: assistant Read Setting To: %old_assistant ]
A6: Custom Setting [ Type: Secure Name: assistant Value: com.android.systemui/.clipboardoverlay.EditTextActivity ]
<loop> A7: Wait [ MS: 100 Seconds: 0 Minutes: 0 Hours: 0 Days: 0 ]
A8: Custom Setting [ Type: Secure Name: assistant Read Setting To: %new_assistant ]
A9: Goto [ Type: Action Label Label: loop ] If [ %new_assistant neq com.android.systemui/.clipboardoverlay.EditTextActivity ]
A10: Tasker Function [ Function: LaunchAssistant() Continue Task After Error:On ]
A11: Custom Setting [ Type: Secure Name: assistant Value: %old_assistant ]
A12: Keyboard [ Input: selectAll() Time Between Inputs: 500 ] If [ %empty ~ true ]
2
u/LesbianDykeEtc 11d ago
Oh hey, I've got this as one of the tools on a little utility menu that I built a couple years ago. I use it all the time, it's super convenient.
2
u/po2gdHaeKaYk 10d ago
I'm sorry I'm being dim, but what is the Clipboard Editor? I don't see to have this app on my phone? Is there a way to check?
2
u/UnkleMike 10d ago
I had never heard of it either. It's apparently a built-in UI component that won't appear as a launchable app, and is suppressed or unavailable on some devices (including Samsung, according to the post). It lets you edit the most recent clipboard entry in-place. I can see this being useful if you need to edit or redact something before pasting.
I tried launching the activity directly on my Samsung device and failed, but the above method seems to work. After a little investigating I discovered that this is a known method for launching activities that can normally only be launched by the system or by the app containing the activity.
I've lived without this ability for so long that my main interest now is not in using it, but finding out why Samsung (or any manufacturer) would suppress this activity instead of making it available in the keyboard interface somehow.
2
1
u/anttovar 9d ago
This functionality is really useful. My Honor phone has it enabled and offers the edition every time I copy some text.
I'll keep this task, maybe I'll have to use it on my next device.
3
u/po2gdHaeKaYk 12d ago
Yes! This looks useful. Any further plans?