Closed moritzdietz closed 3 years ago
I did find a bug with this command though! When you try it out, images are indeed moved out of the clipboard
tab and moved into the Images
, but normal text get's moved there as well.
Could this possibly be an issue? Or is this "overridden" from inside the command and not displayed in the GUI?
I did find a bug with this command though! When you try it out, images are indeed moved out of the
clipboard
tab and moved into theImages
, but normal text get's moved there as well.
For me, the command moves only images. Maybe the clipboard contains both text and image format and that's why it gets moved.
Could this possibly be an issue? Or is this "overridden" from inside the command and not displayed in the GUI?
I think the input format: text
label in this case only indicates that input()
and placeholder %1
in the commands provide the clipboard text if available. It could be more specific: input format: text if available
Simple workaround would be to avoid the move if there is also text:
[Command]
Automatic=true
Command="
copyq:
var imageTab = '&Images'
function hasFormat(formatRegExp, formats) {
return !formats.every(function(e){
return !e.match(formatRegExp)
})
}
var formats = dataFormats()
if (hasFormat(/^image\\//, formats) && !hasFormat(/^text\\/plain/, formats)) {
setData(mimeOutputTab, imageTab)
}"
Icon=\xf03e
Name=Move Images to Other Tab
Ok so this should be ready now! 😃
Merged. Thanks!
This PR updates the
move-images-to-other-tab.ini
command so that it matches all MIME types ofimage/
instead of only matchingimage/png
.This was previously discussed here https://github.com/hluk/CopyQ/discussions/1536#discussioncomment-193452. This PR is ready for review.