Last active
April 29, 2025 05:27
-
-
Save hmijail/5676ce439edbd3c1c5a0e46e04c5293a to your computer and use it in GitHub Desktop.
A CopyQ command to implement a Clipboard FIFO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Command] | |
| Command=" | |
| copyq: | |
| //Works as of CopyQ v10.0.0 | |
| var c = count() | |
| if (c==0) { | |
| popup('Nothing to FIFO-paste') | |
| abort() | |
| } | |
| maxrow = c-1 | |
| select(maxrow) | |
| try { | |
| paste() | |
| } catch (e) { | |
| // Pasting failed! | |
| popup('Pasting Failed', e) | |
| fail() | |
| } | |
| popup('FIFO pasted', str(c-1)+\" remaining\", 2000) | |
| if (config('move') == 'true') { | |
| remove(0) | |
| } else { | |
| remove(maxrow) | |
| } | |
| " | |
| GlobalShortcut=meta+ctrl+alt+v | |
| IsGlobalShortcut=true | |
| Name=HM Clipboard FIFO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's because of the value of the
movesetting (Preferences -> History -> Move item to the top). Whentrue, the script needs a tweak. The reason is that theselectfunction not only selects but can also move depending on that setting. You can have it like the following to work with both values: