Macro: Extract Found Image Image and Replace with Path

I've managed to remove the need for Preview by using the Write to a File action instead. Much neater.

This creates a folder in a parent directory ("Found Images" in this case), named according to the currently selected macro. Fortunately, subsequent runs within the same macro appear to add images to this folder rather than create it anew. I'm not looking a gift horse in the mouth!

It then saves the image selected in KM as a .png and names it according to the action name and action ID. This is great (for me at least) because it differentiates the image from others that may be in identically named actions, but also means that if you replace the image in the image well and run this again, it will overwrite the previous file (as the action ID doesn't change), unless of course you rename the action.

What I haven't managed to figure out yet is how to get the group name in order to create a more easily useable folder hierarchy.

Found Image - Image to Path.kmmacros (39.7 KB)
(Updated: Now works with "/" in Macro/Action names)

Screenshot

This will preview the selected action's image path in a floating window in KM, for use with troubleshooting:

Display Image at Path.kmmacros (40.8 KB)

Screenshot

3 Likes