Wanted: Keyboard Maestro Automation with JPEGMini

Hi, I’d really like to automate JPEGMini, but I can’t seem to figure out how to open files in JPEGMini. Ideally I could select files in finder and activate KM.

Help appreciated.
Thanks!

Hey Arlen,

Substitute the path to JPEGMini for the path to BBEdit in the following script. You can simply drag the app into the Terminal.app to do this and then paste the command part in front of the path.

mdls -name kMDItemCFBundleIdentifier "/Applications/Applications_Chris/Text_Editors/BBEdit/BBEdit.app"

If there are any spaces in the path it MUST be quoted.

You'll get something that looks like this:

kMDItemCFBundleIdentifier = "com.barebones.bbedit"

Substitute JPEGMini's Bundle ID for BBEdit's in this AppleScript:

tell application "Finder"
  set finderSelectionList to selection as alias list
  if finderSelectionList ≠ {} then
    open finderSelectionList using application file id "com.barebones.bbedit"
  end if
end tell

When you run the script using a Keyboard Maestro Execute an AppleScript action it will open the SELECTED items in the Finder in the given app.

That should work, but you'll have to test.

-Chris

Thank you so much Chris. The problem is with JPEGMini.
There is a KM command to open files in an application, but I get the same error using that command as well as your Applescript.

It seems JPEGMini just refuses to be automated. :frowning:

FYI- This is the error I get
The document “548702-1385544-295x59-clearbenchlogo.jpg” could not be opened. JPEGmini cannot open files in the “JPEG image” format.

JPEGMini will process the image fine if I use the Open Command within the app or if I drag and drop the file onto the dropzone.

I appreciate the response!

Hey Arien,

Will it take files dragged and dropped from the Finder?

(I’m guessing not.)

One other thing to try is to open the JPEGMini.app package in the Finder by right-clicking on it.

Drill down to the application

Similar to this:

/Applications/Text_Editors/BBEdit/BBEdit.app/Contents/MacOS/BBEdit

Then use the full path in the Terminal:

open -a “Your-Full-App-Path” “Posix path to a .jpg file”

Go ahead and quote both paths.

If that doesn’t work then it’s pretty much the last shot.

At that point I’d really start really fussing at the developer.

He/she/it wants $20.00 for a crippled application, when GraphicConverter is only $39.95.

-Chris

Hi Chris, I found this old topic while trying to automate JPEGmini. The application takes dragged and dropped files from the Finder.

It's full path is

/Applications/JPEGmini/Contents/MacOS/JPEGmini

How should I proceed with Keyboard Maestro? (newbie here)

Activating JPEGmini, pressing cmd + O (for open file) and choosing the finder selection then should do the job.

I am grateful for your reply,

Chris (as well)

Hey Chris,

I'm flabbergasted that the developer still has no understanding of what batch processing means.

JPEGmini still won't even take files from the Finder dropped onto the Finder icon like any normal application would. I still don't have anything nice to say about their UI design.

Meh...

A couple of worthwhile threads to look at:

Go to specific folder in open/save dialogs

Tell when Open/Save Dialog or Go To the Folder is available

A working demo macro:

Send Finder Selection to JPEGmini v1.00.kmmacros (11 KB)


This is total brute-force, and it shouldn't be necessary.

The silly app even beeps when I manually click the Go button in the open dialog's Go-to-the-Folder sub-dialog with my mouse.

If I had to use this app every day I'd buy Default Folder, so I could directly script the dialog – and then I'd start fussing at the developers on a regular basis.

(NOTE – I already own a copy of Default Folder.)

-Chris

1 Like

I do not know JPEGmini, but use ImageOptim instead.

And it can open be used open directly from a KM macro.

See below.

And there exits a lot of commandline tools, which can optimize images.

Keyboard Maestro 8.2.4 “Open finder selection in ImageOptim” Macro

Open finder selection in ImageOptim.kmmacros (1.4 KB)

2 Likes

Hi Chris, thanks for your script. Maybe the interface choices are a conscious intention, as the Pro version comes with a Lightroom plugin and no other automation features might be in the interest of the developer.

Chris

Hey @qrt,

You might very well be right.

They have a server version that runs from the command line.

In any case I don't like they way they do business and would be actively looking for a different product.

Jimmy's suggestion looks pretty good from an operational standpoint, but I have no idea of how it compares to JPEGmini in image quality.

If you're stuck with JPEGmini then as I said I'd invest in Default Folder to make the workflow as fast as possible.

-Chris