Skip to content

Instantly share code, notes, and snippets.

@hluk
Last active March 24, 2017 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hluk/4a7be6db8fe1c072469e to your computer and use it in GitHub Desktop.
Save hluk/4a7be6db8fe1c072469e to your computer and use it in GitHub Desktop.
CopyQ - Store Copy Time
[Command]
Automatic=true
Command="
copyq:
var item = unpack(input())
item['application/x-copyq-time'] = dateString('yyyyMMddhhmmss')
write(0, \"application/x-copyq-item\", pack(item))"
Icon=\xf017
Input=application/x-copyq-item
Name=Store Copy Time
Transform=true
@SamHasler
Copy link

With CopyQ 2.4.8:

Command “copyq eval --
var item = unpack(input())
item['application/x-copyq-time'] = dateString('yyyyMMddhhmmss')
write(0, "application/x-copyq-item", pack(item))”
Exit code: 1
CopyQ client ERROR: Error: Invalid number of arguments!

--- backtrace ---
()@:2
--- end backtrace ---

@hluk
Copy link
Author

hluk commented Jul 23, 2015

Does the error occur every time you copy something?

Make sure Format field for the command is application/x-copyq-item.

@m4r71n
Copy link

m4r71n commented Mar 9, 2016

With the command above an empty item will be created with only the timestamp as application/x-copyq-item.
But https://github.com/hluk/CopyQ/wiki/Command-Examples#show-copy-time works

@hluk
Copy link
Author

hluk commented Mar 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment