Need Help Displaying Many Clipboard Items Quickly in Raycast Extension #2543
Replies: 2 comments 5 replies
-
You can print all items in one go with null character ( copyq tab SOME_TAB 'separator(String.fromCharCode(0)); read.apply(this, [...Array(size()).keys()])'
They use a script to create an array with all the items and print it as JSON. Here is a simplified version: var result=[];
for ( var i = 0; i < size(); ++i ) {
result.push(str(read(i)));
}
JSON.stringify(result); You can pass the script to CopyQ with: Here is a faster version without any loops and empty texts: copyq tab SOME_TAB 'JSON.stringify(ItemSelection().select(/./).itemsFormat(mimeText).map(function(x){return str(x)}))' |
Beta Was this translation helpful? Give feedback.
5 replies
-
Issue resolved with last reply. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on a CopyQ extension for Raycast. My extension works as is, but because I am not sure how to utilize CopyQ's terminal command efficiently, I am displaying clipboard items by running "copyq tab {tab} read {index}" where the command is run an index amount of times.
Using the terminal in this fashion takes a while, so I've added default_num_items (set by default to 10). As a result, the extension only displays 10 clipboard items because showing the whole list could take a very long time.
I am looking for someone who can point me in the right direction to list all clipboard items in a directory in a much more efficient way. I can handle things on the Raycast side, but if someone can find a replacement for looping through the "copyq read" command, I can display much more clipboard items while removing the need for a default number of items.
I have looked into this repo for inspiration, but I am having difficulty comprehending what is being executed.
Beta Was this translation helpful? Give feedback.
All reactions