Automatically Approve Zoom Links from Safari Macro

I got annoyed because every time I click a Zoom link, Safari shows me this dialogue:

So I made a simple macro that automatically clicks the "Allow" button using a found image:

Automatically Approve Zoom Links.kmmacros (20 KB)

1 Like

I think that should work, but it will only trigger when Safari activates. I guess Safari will always activate when you click on a link in some other app, like Mail, but if the link is within the Safari app, I don't think it will trigger.

Also, I wish to note that your approach of using a "Pause for 1 Second" is probably necessary, but with a little change you can put the Click action into a loop and have it continually search for a few seconds and click as soon as it finds it, instead of waiting one second. This will work faster. But if speed isn't important, don't worry about changing this.

Right, the use case is that I get Zoom links in calendar invitations, so I'm clicking from Fantastical (or would also work with Calendar).

The timing issue was that in some cases it takes a little time for the %SafariURL% token to update to the Zoom URL, particularly when Safari is launching. So it needs the pause before evaluating whether to start looking for the found image at all, unless I wanted it to run on every web page (which seems excessive).

Okay. I think I didn't accurately grasp what your IF statement was doing. But even so, my loop technique could be used to search for "zoom", still resulting in a faster macro. But if speed isn't important, don't worry about it.

Nice job! I do something similar as part of a larger macro, but I use the following action to click the allow button. This way it's not dependent on found images.

Press a Button Action (v10.0.1)

Press a Button.kmactions (403 B)

Keyboard Maestro Export

3 Likes

Does that work in a Safari pop-up? I had no idea! What about other Safari window pop-up like "No Thanks" which I see a lot.

I'm not sure about the "No Thanks" popup or others, but it works flawlessly every time in the "Do you want to allow this page to open “zoom.us"?" popup. :grin:

Okay. I had just assumed anything that popped up in Safari was Javascript code and not Safari code. I was clearly wrong. I'll try to recognize the difference in the future.

To be honest both JavaScript and Safari code are beyond me... I was just messing around with my macro one day and realized the Button action worked like a charm :+1:t2: :grin:

1 Like

Oh wow, that's much better! I should have thought to try that.

1 Like

I was just making a new macro and realized that the press a button action also works with the popup asking if you want to store or update your Keychain password, so it looks like it has pretty wide-spread compatibility.

2 Likes

Apple should include a Safari logo in any pop-up that's generated by Safari rather than by Javascript.

1 Like

So what would be the most efficient way of constantly monitoring Safari to see if a zoom link had been clicked external to Safari or even within Safari and that allow window/button came up? Just want to learn what you folks think would be the least straining on the system at the same time efficient and constantly monitoring.

Good stuff, cheers

It looks like the best way is to use a Focused Window Trigger, as @gglick suggests here:

I'll add that soon, it's a good idea.

1 Like

Here's a new version that works from within Safari as well as from other apps (and incorporates @cdthomer's suggestion too):

Automatically Approve Zoom Links.kmmacros (4.4 KB)

5 Likes

Personally I went a different route for a similar situation with Amazon Chime links. Instead of automating clicking a button in the browser, I used Finicky (open source app from John Sterling) to rewrite the URL to the format that launches directly in the native app. I think something similar should work for Zoom too, but you'd have to find out the URL format for launching zoom.us.app to make it work.

Here's the config I used for Amazon Chime:

module.exports = {
  defaultBrowser: "Choosy",
  // Rewrite Chime Meeting links to launch the native app instead of in the browser
  // Browser URL format is https://chime.aws/xxxxxxxxxx (10-digit meeting ID)
  // Native app format is chime://meeting/?pin=xxxxxxxxxx
  rewrite: [
  	{
  		match: "chime.aws/*",
  		url: ({ url }) => {
  			return "chime://meeting/?pin=" + url.pathname.slice(1, 500);
  		}
  	}
  ]
}
1 Like

Hey Jake,

You're using both Finicky and Choosy?

I don't know what the macOS requirements are for Choosy these days, but I think it can do this job by itself – and it has a UI for folks who's js.fu is not yet strong.

https://www.choosyosx.com/

-Chris

Heheh - yea. Forgot about that. I use Choosy for most browser targeting, but I found Finicky easier to configure for rewriting URLs. I'm actually not sure Choosy can do that part, but Choosy was happy to accept Chime as a browser target. :man_shrugging:

It might work with just one or the other though. Haven't tried.

1 Like

Very interesting. I'll have to monkey with Finicky.

I've been eying Choosy for some time, but I normally only use one web browser and haven't really wanted to add yet another utility to my menagerie.

-Chris

A user on another thread found that this macro was causing problems. It reminded me that I've modified it a bit, so here's the updated version. I'm now running it from within the Safari macro group, which means it fires less often (although still a lot!).

Approve Zoom Links Macro (v10.1.1)

Approve Zoom Links.kmmacros (27 KB)