hluk / copyq-commands

Useful commands for CopyQ clipboard manager.
331 stars 73 forks source link

Separate tabs for long items #46

Closed pesader closed 2 years ago

pesader commented 3 years ago

First of all, thanks for developing CopyQ! By now, it saved me countless of hours of work, all the while looking incredibly pretty (the UI and UX are top notch).

In my daily usage I often find myself copying a lot of lines at once, such that a single item fills up the entire CopyQ window as seen in the image below.

image

How would I go about creating an Automatic script to move these long items to a separate tab (perhaps named &long)? I took a look at the Scrpting API documentation but haven't gotten any ideas from it. So far, I have a hunch that a modified version of the Big Data Script may do the trick.

Thanks in advance!

hluk commented 3 years ago

Maybe use a simpler version of the "Big Data Tab" automated command:

[Command]
Automatic=true
Command="
    copyq:
    var tabName = '&long'
    var minBytes = 10*1000
    if (data(mimeText).size() >= minBytes) {
        setData(mimeOutputTab, tabName)
    }"
Icon=\xf039
Name=Long Text Tab