Convert an HEIC Image to JPG

This is what I too was referencing. How can it be accessed via KM?

I am confused, though, because while I thought this Shortcut was new in Monterey, it shows in Finder as a Quick Action, and they have been around for awhile (apparently — I never knew they existed before). IOW, it's a new Quick Action, not a new Shortcut, afaict.

I had no idea you meant "Monterey Shortcuts" because (a) you didn't say that, and (b) you mentioned "four output sizes" and that's not what Monterey Shortcuts offers in its Convert Image action. So naturally I thought you were talking about something else, which I probably assumed was Automator, which also uses the term "Quick Actions".

When you said, "How can it be accessed via KM," are you talking about Monterey Shortcuts? If so, they can be accessed via the "Execute Shell Script" action using the macOS command "shortcuts run name-of-shortcut". There are about eight different ways to access Monterey Shortcuts, but I presume that's what you are asking about.

I remain confused — are there different "Convert Image" utilities? I am seeing four image size options when in Finder I bring up a context-sensitive menu with an image file selected and execute "Quick Actions ▹ Convert Image". They show like this when I click the drop-down icon to the right of the "Image Size" field:

In the Shortcuts program on my machine there are only 6 Shortcuts and none are named "Convert Image" or anything like that. When I try to run a Shortcut named "Convert Image" using either the KM Action "Execute AppleScript" or "Execute Shell Script" I get, unsurprisingly, either an error or nothing happens.

You would need to build your own OS Shortcut, looking something like this and then call that OS Shortcut from Keyboard Maestro using the method @Sleepy has suggested.

image

To call this OS Shortcut from Keyboard Maestro you would use an Action like this:

image

In the above example I made an OS Shortcut and called it "ConvertImageJpeg".

OS Shortcuts are similar to Keyboard Maestro Macros in that they are formed from blocks that you put one after the other, a bit like Keyboard Maestro Actions.

What you showed is definitely not Monterey's Shortcut's Convert Image action. I have plain macOS Monterey. I'm guessing that you installed something that gives you that "Quick Action." So when you said "That is what I too was referencing," I don't see that as being correct. @Zabobon 's post may clarify it for you.

So going back to my original comments, when I said, "I don't think anyone mentioned that Monterey macOS has new built-in image conversion through an action in shortcuts which you can access from KM," I think that comment still stands as a fresh new idea.

HEIC from Download to JPG on Desktop.kmmacros (6.6 KB)

Incase anyone needs this, I edited the macro so it converts a heic file airdropped from iphone to downloads on Mac, then converts it to jpg and deletes the heic file

1 Like

I just downloaded this - great contribution!

Hi All,

I've forked this macro to convert WebP files that are saved into my Downloads folder and then convert them to JPG. The macro then moves the JPG file into a subfolder within my Downloads folder (i.e., _webP2JPEG).

My first question is, should I just start a new forum topic, or is it appropriate to extend this existing one?

Assuming it is okay....(if not, I'll move this into a new topic later).

Here's a bit more context for the problem I'm trying to solve.

The image file conversion portion of the macro works fine. THANK YOU all for creating the original macro.

I would like to try and make my forked macro a little more efficient so that it only evaluate files with a WebP extension. I'm noticing in the Engine log that it appears to be processing the entire contents of my downloads folder each time a file is saved there.

My concern is I've noticed that I'm getting a lot of failed messages captured in the Engine.log. I do not have great 'file hygiene' within Downloads. It is basically my junk drawer.

I'm using a "For each item in collection" action with the folder collection by date added, with "Reversed selected", and I've also run it with "Reversed deselected". I'm not seeing any difference in the behavior of the macro.

What I'm trying to do is test each entry in the Folder Contents collection to see if it's a WebP file and then process that file. I'm assuming, since it's the newest file added into the Downloads directory, that the sort order by date added would put that at the top of the stack. It does not appear to be working that way.

There are approximately 50 entries in the Engine log each time this macro is run regardless if I have "Reverse" option selected in the "by date added" attribute of the "for each item in a collection" action.

Engine.log content

2026-03-19 07:21:57 Execute macro “WebP to JPEG from Download to _webP2JPEG” from trigger Anything is added to folder “~/Downloads” (ignoring partial or changing files)
2026-03-19 07:21:57 Failed to get sort for /Users/username/Downloads/.jpg
2026-03-19 07:21:57 Failed to get sort for /Users/username/Downloads/
2026-03-19 07:21:57 Failed to get sort for /Users/username/Downloads/
and this patter repeats for ~50 entries

macro screenshot

Yes, because you've told it to with

...pointed at your Downloads folder.

The point of the Folder Trigger is that when an item is aded to the watched folder the macro fires and the path to the added item is available to the macro via the "%TriggerValue%" Token -- you can process that item directly rather than having to process the folder's contents to find the file you want.

Luckily you aren't breaking anything, but if you follow the macro's logic you'll see that when you add a file with a webp extension you then move every item in Downloads to... Downloads.

Unless you've added the "For Each" to cater for a folder of WebP images being downloaded? In which case you'd need to "For Each" the contents of %TriggerValue%, but you'd also need to built in a pause to allow multiple files to be downloaded. And maybe think about dealing with folders of folders of images :wink:

Have a crack at fixing it, but if you get stuck then please make sure you upload the macro itself (not just a screen shot) so people can help.

Thanks for the pointers @Nige_S

I have cleaned up some things. The macro works but it is slow compared to Finder Quick Actions > Convert Image. This macro runs automatically without my intervention which is a big value add but the performance penalty is high.

Converting 12 webp files using this macro takes about 100 seconds.

Converting the same 12 webp files using Finder Quick Actions > Convert Image takes about 2 seconds.

WebP to JPEG from Downloads to _webP2JPEG.kmmacros

WebP to JPEG from Downloads to _webP2JPEG.kmmacros (9.6 KB)

Convert Image screenshot

Every time this macro fires, you are parsing the entire downloads folder:

Unless I'm really misunderstanding something, you don't need that. Make a duplicate of your macro (just in case). Then take everything in the macro that's inside that For Each loop, and move it outside, and then delete the For Each loop.

Now the macro will just run once each time it finds a new file in the Downloads folder, and it should be quite fast.

-rob.

THANKS @griffman

I did not understand %TriggerValue% for the Folder action would include the full path including the file being added to my Downloads folder. I assumed the value would only include the path to my Downloads folder.

I was looping through all of the content in Downloads because of this misunderstanding.

The macro now runs fast. I processed 24 files in less than one second.

WebP to JPEG from Downloads to _webP2JPEG.kmmacros

WebP to JPEG from Downloads to _webP2JPEG.kmmacros (8.9 KB)

1 Like

Glad you got it working!

For future reference, a good way to see what a token (of which there are many) holds is to just put it into a Display Text action, so you can see its value at some point in your macro's execution.

In your case, adding a Display Text for %TriggerValue% as the first step in the macro would have shown that the full path is stored in the token.

-rob.

2 Likes