hluk / CopyQ

Clipboard manager with advanced features
GNU General Public License v3.0
8.7k stars 441 forks source link

Is it possible for a script to call an external command? #1684

Open cjohnsonuk opened 3 years ago

cjohnsonuk commented 3 years ago

Is your feature request related to a problem? Please describe.

I can't edit the contents of the clipboard in a way I would like without using an external format conversion tool. I can't see how to call that tool from within a script in CopyQ

Describe the solution you'd like I'd like to create a script to give the option to "paste formatted text as wiki markup" . I want to be able to copy html or formatted text from a document and paste as formatted wiki text. I can do the conversion using pandoc but I don't know if I can use copyq to send the clipboard text to pandoc and put the output of pandoc back in the clipboard

Describe alternatives you've considered I can save the whole document or paste formatted text from a webpage into a document, then save the document then run pandoc to convert it, then open the converted document , then copy the wiki formatted text and paste it but that workflow is not very streamlined. Searching google there appears to be an option without using copyq to directly edit the clipboard but IIRC it was for Linux. I need to be able to do this on Windows and Mac and integrating it into CopyQ if possible would minimise the requirement for additional software.

hluk commented 3 years ago

You can use execute(...) to call external utilities/tools.

You can see some usages in copyq-command repo, for example: https://github.com/hluk/copyq-commands/blob/ad4203087c7fc35e10761ec25796437b44acb9c4/Global/convert-markdown.ini#L69