Macro Misbehaves Due to AntiVirus System

Well, in each part of the macro you had 2× Resize Image to 600×600 and 1× Resize Image to Fit 600×600, so you are resizing the image 6 times (!), and writing it 2 times as JPEG.

(You are aware that JPEG is a lossy compression, right? With each compression run you loose quality.)

I threw out all the duplicate actions, and it still works here.

Besides the literal duplicate actions, what is the point in combining a Resize Image with a Resize Image to Fit action (with the same dimensions)?

Indeed, when several (or maybe all?) macros stop working at the same time, then most likely KM Engine has some fundamental problems to do its job.

I tend to think this too. You could create a fresh user account, and see if the issues happen there, too. But since it seems to be intermittent, this can become time consuming.

There is a troubleshooting post about permissions, in case you haven’t seen it yet:

1 Like

Thank you for this Tip. I really just use this to size TV artwork for iTunes so it being JPEG is totally fine. But for some reason I need it to run all actions twice for it to work.

This is great!

Out of curiosity: How old was the OS? (Since the last “clean” install.)

I spoke too soon I am having the issues again.

I was using Mojove but I did a clean install about 1 month ago.

What can I run in KM to see the log and maybe ID the issue?

Then the OS really should be fine. (Unless you install lots of weird stuff in the form of drivers, kernel extensions, low-level background processes, …).

Was this still the case even during the week when everything worked fine?

As mentioned, on my computer the macro runs fine without all the duplicate actions. I would start investigating there. Try to find out which type of actions require to be executed twice (Only image-related actions? Only Finder-related actions? Any action?)

Where can I pull the log for KM Engine to see what is causing this error before I re-start my computer and it starts working again?

It always seemed to be related to that action in Finder, but always worked in my Path Finder group. I will try to move the macro out of the finder group and see if it works globally without the duplicates after I restart the comp

Here are the errors in the log:

2020-02-20 09:00:22 Execute macro “16)Resize JPEG Images (Mac Pro)” from trigger The Hot Key ⌃⌘I is pressed
2020-02-20 09:00:22 Async NSAppleScript error 2020-02-20 09:00:22.276 CompileAppleScript[78833:9688664] Keyboard Maestro Internal AppleScript Execute Error: Finder got an error: Can’t get alias "/FILE NAME".

The error message here is about ALIAS.

2020-02-20 09:00:29 Execute macro “05)Multi-Item Edit” from trigger The Hot Key ⌘M is pressed

The Error message I get from the App is also about an ALIAS.,

Seems you have found the log.

Indeed, similar as with your iTunes macro above. Probably @peternlewis can help here.

The tips from Peter’s Permission Issues post I linked above didn’t help, right?

In the post you deleted you said you didn’t see the issues for one week after the fresh OS install. If this was true (the one week without issues), then try to remember what you did after that week. What did you change/install? (Especially things like mentioned here.)

I didn't look yet because my logic was if it works 90% of the time why would permissions change randomly. I was thinking it was related to the computer going to sleep but it appears to be related to when I edit macros on this machine than I need a re-start and I get this ALIAS issue.

So I haven't touched this machine once, The Marcos were working until I went to edit the Macro in the Finder group. I haven't installed or updated any software or updated any apps over the last week, ;ll go through that link now

Actually the post is pretty much exactly about that:

[…] so anyone would assume that means they have permission, but the system is actually lying, and you have to toggle the checkboxes off and on again to grant permission - who would even think to try that?

So, maybe it’s worth to read it. I don’t think that is related, but who knows. You always want to exclude the more common potential causes first.

Good idea. Next time I see the issue I will try toggling and see what that change. For now I have re-started the comp so I can use everything.

Going to look into that Finder resize image issue right now.

Yes, and consider reading the rest of the post too.

What I would also look at, is the system log. Maybe it gives some additional clues that are not in the KM Engine log, e.g. other strange things that happen around the same time when your macros start to fail.

(The Console app window may look different with Mojave.)

This is super helpful, next time the issues occur I'll check both of these things thank you!

So this has happened to me again today. I have the console open, no clue what I am looking at here but new lines get added every 1 second so I can't even read one line without an entire set of data pops up.

Anything I should be looking for? I tried the failing macro but just keep the same few items repeating.

  • You can filter the log for errors and faults:

  • Once you start scrolling the log window, the entries stop “moving”.

Yes, this is the main problem when reading logs. Unfortunately I don’t have a definitive answer for you.

But thanks to your question I did a little research and found Ulbow [direct download], an interesting app by Electic Light. As it happens, they have released a new, feature-complete, beta yesterday.

It’s a helper app, for reading system logs more efficiently.

If you’re interested:

In the accompanying PDF, read at least the sections “Start”, “Main Window Layout” and “First Time Setup”.

Then, the most important part for you comes on page 6 of the PDF:

And also the blog article for the app has some good information.


BTW, also for other readers, Electic Light has lots of useful little tools, amongst them a couple of other log readers, but also utilities for Time Machine, file tools, alias tools, tools for analyzing iCloud, permission, security or sandboxing issues, etc.

See the product page – and they’re all free. (Be prepared to invest some hours investigating all their tools :wink: )

Also their pages on Mac Problem-Solving are highly recommended.

KM uses the macOS log system. You can view it here:
GoTo menu Help > Open Logs Folder, or just open this file:
~/Library/Logs/Keyboard Maestro/Engine.log

You may also find this macro helpful:

MACRO: Display Last KM Macro Error

This is helpful. I know how I'll be spending Saturday morning.

Quick Update here.

I read a few of the issues one one of the above links and it mentioned an anti-virus software. So 7 days ago I Uninstalled intego antivirus from my Mac. So far this issue with triggering scripts has no occurred and it was occurring every day so for now I will call this a solution and thank everyone for their help!

1 Like

Yep, that’s the post I first pointed out to you 17 days ago :wink:

Great that it works now, and thanks for the feedback!