Is it possible to store images on variables?

I would really like an option to store images to Keyboard Maestro app variables. Is it technically possible?

Technically yes (see here for a roundabout example of how) but for most intents and purposes, the answer is “no”. Fortunately, it is possible to store images in named clipboards (along with rich text and other non-plain text objects) which can be used in very similar ways to variables depending on your purpose.

2 Likes

Thanks for sharing! This looks technically advanced for me, but I will do a bit of reading tomorrow morning. :slight_smile:

1 Like

The variables are text values, so you could Base64 encode, and then decode when you need them.

(See the base64 ‘execute shell script’ example here: Find Image on Screen using Clipboard Image? )

Update - forgive me - that link was already posted …

Or you could store the image in a file and put its file name wherever you like. Then the recipient uses that file name.

Most software can import an image from a file almost as easily as it can paste one from the clipboard. (PowerPoint, I found out, generates a much smaller presentation file by importing from a file than it does by pasting an image.)

Hey Arun,

As @ComplexPoint has mentioned it is possible, but you really don't want to clog Keyboard Maestro's memory space with images.

Better to put them in Saved Clipboards or use files on-disk.

-Chris

1 Like

Thank you, Chris! I shall try this too.