Clipboard format

I have a nice KM macro that allows me to take a screen shot, save it in a special place, open Preview with that file and open the print dialog box. It works great if I keep the default file format for screen shots (png). However, I prefer PDF format for screen shots, so I changed the format using Cocktail. That breaks my macro because of this step:

Here is the full macro:

Thanks for listening.

ekiM

How does that step fail? Is anything recorded in the Engine.log file? (Help ➤ Open Logs Folder).

The “Write Clipboard to File” step does not allow me to choose PDF as a file type. If I have PDF chosen through Cocktail I get this error:

2015-01-19 11:04:31 Write File action failed to read source image

If I switch to have png as the screen shot type set in Cocktail, it works as expected. It seems that the clipboard storing as PDF, but KM is trying to make a PNG out of it.

Keyboard Maestro is trying to read the clipboard as an image. It actually does that by asking the system image subsystem to read the image from the clipboard. Apparently it cannot read a PDF as an image (which is perhaps not that surprising, since it is not an image format, but a document format). It can’t read a Pages document as an image either.

I suggest you use an image format for your screenshots, but if you really want to use a PDF format, then you will need to accept that its not an image and that has consequences.

Peter — thanks for your clear explanation, it makes sense that an image should stay in a graphic format. I will change my screenshot format back to png or jpeg. Mike

Generally don’t use jpeg for screenimages (or any computer generated images) - jpeg is designed to blur edges for better compression which makes very obvious artefacts on images with sharp lines and fine details like text.

I don't agree. JPEG is fine unless you compress it too much. OSX's default produces a very acceptable JPEG screenshot. (Although I cannot speak to what it does on a Retina Mac as yet.)

Not that there's anything wrong with PNGs, but the size difference can be significant:

Screen Shot 2015-01-20 at 19.31.02 CST.png	1.7 MB
Screen Shot 2015-01-20 at 19.33.25 CST.jpg	600 KB
Screen Shot 2015-01-20 at 19.37.07 CST.jp2	469 KB

--
Best Regards,
Chris

Many, many years ago I read/learned that GIF is a better image format for text and drawings, while JPEG is better for photos. So I generally save my screenshots as GIF.