KM Would Like to Administer Your Computer

One of my macros will run shell scripts after trigger. I got below pop up before it run scripts. Is there a way to disable this pop up? Thanks.

What happens when you press "OK"? I would expect you not to be asked again.

Press OK the macro runs ok. But it pops up every time this macro triggered. I do have sudo commands in that script. Is there a way to disable this popup?

googling the problem turned up a solution relating to the Terminal app. Maybe it could work for KM too:

1 Like

Thanks @tiffle.
I did a few quick searches and tried before I posted this. The link you posted came up first in the result, I tried but pop up still appear. Seems the command is 'reset' permission, not 'disable' the popup.

1 Like

OK @henryone, sorry it wasn’t helpful.

1 Like

Is there anyway for KM to detect this popup window? I tried "the focused window changes" but it didn't trigger, seems this is not a "window".

Hey Henry,

Nyet. It's a system dialog, and Keyboard Maestro cannot see those.

AppleScript can though.

In any case – I think you might be able to get around the problem by adding the relevant commands to your sudoers file. (No bets though.)

-Chris

1 Like

Hi Chris,

Thanks for responding. Could you show me how to do it in AppScript?

I found an alternative solution using KM. Create a new macro that will try to find the image of that popup and click ok once finds it. set the timeout of 5 seconds. Then in my main macro, execute that macro asynchronously with timeout of 5 seconds. So far it works.

Hey Henry,

Download this little utility:

https://www.irradiatedsoftware.com/downloads/?file=Winfo.zip

Run it.

Run your macro to get your problem window.

Place the cursor over that window, and let me now what process owns the window.

It'll look something like this:

image

-Chris

The owner is UserNotificationCenter

Hey Henry,

Please post the script that is causing the issue.

-Chris

The script adds a new line to the crontab. There are a few more lines in the script but the line cause the popup is like below:

echo 'xxxxx' | sudo crontab -

image .

The user I am running is already in the sudoer list that requires no password to run sudo command.

@peternlewis – can you comment on this thread?

See Post #1.

-Chris

What causes the dialog to appear? It is not a permission I am familiar with.

I couldn't find much online, but one solution suggested was to allow Full Disk Access, which you could grant for Keyboard Maestro.

2 Likes

In this case an Execute a Shell Script action.

echo 'xxxxx' | sudo crontab -

Me neither.

Thanks @peternlewis!
Added full disk access permission and now seems the popup is gone.

2 Likes