If Then Else Setup Not Working for Me

Hi All. Very new to this app. Downloaded the trial today (am going to buy, already found other uses.)
Where has this been hiding for my 30+ years of Mac use?

I am not sure this is a bug or just my stupidity. For such an in your face action and option there of, I have a hard time believing that this is a bug that could have slipped through.

Regardless, I am attempting a macro that moves image files if they fall under a certain pixel dimension conditions. I am moving them to a folder so that I can do a cursory look at them before trashing.

For example, if the image is less than 500x500. (i.e. 300x700 is a keeper)

The problem I am having is when I want 2 criteria checked under the condition that "all of the following are true:" testing against <500 in each dimension. It fails every test I throw at it.

However, If I set it up to use one of the alternate rules. it works fine. i.e. If I test for an image that if "any" are true it will continue on to the "then" action. the other options work too.

That being said, I was able to get my macro to work by testing that both dimensions are "non of the following are true" by setting the test to greater than 500. It just took a little bit of thinking in the negative to accomplish.

Holy crap do I love this app! And if an old man idiot like myself can get the gist of it after only a few hours, this app is NOT elitist, it is actually functional! A rare find these days.

I post this more out of curiosity than I do of critical need since I solved it the other way.



1 Like

Howdy, welcome to the forum! As you might have already figured out, this is a great community full of people who love to help.

If actions can be a little tricky, for sure. If possible, post the macro itself so we can take a look at it and see what might be going wrong. As one of the moderators likes to say, "If we're not testing we're guessing, and guessing often wastes people's valuable time". :laughing: If you need help on how to post the macro, just let us know and we can walk you through it.

If you haven’t had the opportunity to read this tutorial, I highly recommend it. It will help you get the most help for your question.

Tip: How Do I Get The Best Answer in the Shortest Time?



Thank you very much for the quick response! As it turned out, it was me being a dummy and not looking farther up in the script to notice that I assigned one of my variable to "Pixel Size" instead of "Pixel Width"

So, even after I thought I solved it with my tests images. Once I ran it for real, I was still getting strange results. Thus forcing me to dig deeper.

I can't wait to get the hang of this. Been wanting to control the system with python for years now, but never found a good way. It looks like mixing this with Python could be profound!

Seriously, If I would have had something like this in my 30s. I would have probably saved myself 2 or 3 years worth of work by now.

Thanks again!

Neurascenic. (also Chris)


Great news! It's always a relief when it's something simple.

I too am a rather new guy around here; I only discovered Keyboard Maestro in 2018 when I switched jobs and wanted to automate a lot of my workflow. But there's guys around here that have been with Keyboard Maestro for many years, and unlike me, have real programming experience too. So no doubt, whatever it is you want to accomplish with it, somebody else here probably has experience with it in case you run into difficulties.

Have a great day!


1 Like

A piece of advice you didn't ask for here! If-Then actions can be tricky but useful. I have found it useful to make use of the 'cancel this macro'. It seems otiose and I am not sure myself exactly why it works sometimes. It is an action that can stay active without one realizing it sometimes as it 'waits' for a condition to be met which never comes as it were.

Congratulations, @neurascenic! Every programmer eventually discovers de Morgan’s Laws. You seem to have come upon it pretty early.



To be honest, I took a digital electronics course roughly 30 years ago. And vaguely using it. Though, to be honest, I do not recall the term "de Morgan's laws". I thought it was called negative logic. Alas, I was wrong on that too... Updated.


1 Like

I will keep an eye on that one! Thanks!

Since I have been pretty unhappy with any kind of local Digital Asset Manager. KM is kind of allowing me to just use the finder in a way that I wanted a DAM for.

Even though, I do think a dedicated DAM would have the potential to do what I want. None have done so yet.

Just scratching the surface of KM has already allowed me to accomplish some of the things I have been really wanting.

Soooooo Gooooood!

Thanks again!