Best way for JPEGMini Pro action?

I'm excited about the possibilities of Keyboard Maestro and am giving it a test run.
What I can't figure out - and hope you'll help with - is this:

I want to create an action that will take the selected image(s) and run them through JPEGMini Pro.

I really would appreciate your help.
Thank you,

not jpegmini pro, but you can use ImageOptim(free) and Automator:

create it in Automator > New > Quick Action
and then you can use it in Finder > Services

Hi,

JPEGmini Pro seems to be a poorly implemented cross-platform app, so some things aren’t working as they would with “real” apps. Namely, the usual Open With action or a shell script with open doesn’t seem to work, it just returns this:

Screen Shot 2020-03-01 at 14.27.46-pty-fs8


So, we have to do something very clumsy and use the Open menu item in the app’s File menu:

Open Finder-selected files with JPEGmini Pro <F79A 200301T144843>.kmmacros (7.1 KB)

Instructions:

  1. Make sure the macro is in a macro group only active when Finder is frontmost.
  2. Make sure the macro group and the macro itself are enabled.
  3. Change the hotkey trigger of the macro to your needs.
  4. In JPEGmini’s preferences set an export folder.
  5. In the Finder, select one or more JPEG images.
  6. Run the macro via hotkey trigger.

Troubleshooting:

  • If the macro gets stuck somewhere during the Open dialog, try inserting a Pause Until action before the Press Go Button and/or the Press Open Button action. (Similar to the Pause Until Open Enabled action a few lines above.)
  • Other issues: First quit and relaunch KM Engine (last menu item in KM’s File menu).

How the macro works:

For each Finder-selected file it…

  • tests if the file extension is jpeg or jpg
  • makes sure JPEGmini is frontmost
  • opens the Open menu item of JPEGmini and inserts the file path in the Open dialog, pressing the necessary buttons to advance and finish the dialog
  • If one of the selected images is not a JPEG, is throws a notification and continues with the next one in the selection.

Tested with Keyboard Maestro 9.0.5 on macOS 10.15.3.
The macro still might need some fine tuning on your setup.

1 Like