Select Clipboard Image File

Since Safari does not support JavaScript pasted image uploads yet, to upload a picture to a forum (like this one) requires first writing a clipboard image to a file, and then selecting the file - how tedious!

This macro assumes you are currently in the Open dialog to select a file, and you have an image on the clipboard (so you would have clicked the Upload button and the Choose button already). It saves the clipboard to a file, and then selects that file and opens it. Great for posting macro images copied in Keyboard Maestro to this forum in just a few steps.

Select Clipboard Image File.kmmacros (5.4 KB)

1 Like

This looks useful, I'm trying it right now by placing this small screen shot:

(1) The macro leaves me in the Select Clipboard Image File window, where I still have to hit return or click on Choose, and then click on Upload. I suppose this is as intended, since I don't see anything in the macro at least for the final Upload button.

(2) Can you please explain "If The Clipboard: conforms to public.image"?

Thanks.

Yes. I often like to press Space (Quick Look) to verify the image before posting - especially as it is very bad to make a mistake and post the wrong image. You can, if you prefer, add another Type a Keystroke: Return actions.

"conforms to" is talking about the type of a clipboard (or probably more accurately, that at least one of the flavors of data on the clipboard is of a particular type). The public.image is a Uniform Type Identifier, which is a hierarchy of type information. For example, a PNG image is of type public.png, which in turn is a form of type public.image, which in turn is a form of both public.data and public.content, the former is the base physical type for byte streams, and the latter is the base type for all document content.

So basically, it is just asking if the clipboard is an image, which actually is exactly the same as "The clipboard has image" condition.

Really exactly the same as Keyboard Maestro checks for conforms to "public.image" for that condition.

2 Likes

It seems Safari now supports pasting images - I don’t know when that happened, but that’s definitely a good thing!

4 Likes

Hey Peter,

I first noticed this sometime after installing Security Update 2018-002 (Sierra) (released Mar 29, 2018)

I can't be certain the change didn't occur before that though.

-Chris

1 Like

And its gone again. Pasting images no longer appears to work. I don't know if this is a Safari regression or caused by the recent upgrade to Discourse version 2.0.

Sigh.

For what it's worth, I just tried pasting an image from the clipboard in this reply in Safari 11.1.1 on High Sierra 10.13.5, and it still works fine for me on the newly upgraded Discourse 2.0 version of the forum.

1 Like

Well that is interesting. It's not working for me trying to paste screen captured areas/windows.

I'm on the same versions as you, I wonder what the difference is.

Ahh. Turns out it is the StopTheMadness Safari extension, apparently there is some bad interaction happening there. Disabling it restores the pasting of images.

Thanks.

1 Like