MACRO or PLUGIN: Open or Refresh a URL in a Tab (Safari & Chrome)

THANK YOU FOR THIS! So great for bringing my CRM web app to the front.

Hey! Thanks for this awesome script! I use Microsoft Edge. How do I add it in the macro?

I tried to Delete the Macro from the Kayboard Maestro and now I'm getting this error. Can anyone please help?image

This works with Microsoft Edge with two edits.

  1. After you load the macro into KM, select the macro and expand the third action, "Parse Parameter into [...]".
  1. Expand "Do the work".

That's it for edits.

Remember put "Microsoft Edge|" as the first part of the parameter passed to the macro. An example:

1 Like

Ditto for Brave Browser! Thanks!

This works beautifully on the Stream Deck using KMLink, for those interested.

1 Like

@DanThomas, thanks for sharing this fantastic macro.

@John_C, thanks for the tip to regarding the Can't convert types error.

@slamm & @fearoffish, thanks for sharing the Microsoft Edge and Brave Browser information.


For those using the macro...

I observed that I need to include a trailing slash if I'm specifying a URL that ends with the domain, e.g.,

https://forum.keyboardmaestro.com/

If the slash is excluded, a new tab is opened even though it seems there is an exact match.

Contrastingly, when specifying a URL that does not end with the domain, the URL specification is as expected, e.g.,

https://wiki.keyboardmaestro.com/manual/Single_Page_Version#Tour
1 Like

Upon further testing today with Safari v16.0 (18614.1.25.11.1), Ventura developer beta 5 (even after making the change @John_C suggested), I found that if Safari is open but there are no open windows, calling this macro generates:

This can be avoided by adding the following group of actions before calling the macro.

Group.kmactions (5.2 KB)

Keyboard Maestro Export

Hi All,

I just found the Orion browser and it's exciting, especially as both the Mac + iOS versions take Chrome and Firefox extensions (though not all work yet). It also has an amazing implementation of vertical tabs: it INDENTS tabs opened from given page under the tab for that page, so you end up with a "heirarchical outline" of tabs organized by which tabs came from which pages. This not only organizes a sea of tabs into something that makes sense, but lets you see how many pages are left to go through for a given search if you've Cmd+clicked a bunch of links! It's pretty great seeing progress and knowing how many results are left as you Cmd+W (close) one tab after another...rather than having to wait for the search page to show again to find out!

Anyway, I write this because I'm trying to make this Macro work with Orion (I had gotten Brave to work in the past), but am getting the message:

I tried adding the steps to bring browser to front recommended by @_jims (changing Safari to Orion) but didn't seem to help.

Hoping for any assistance. Thanks!

@DanThomas Would be nice to have option to select other browser besides safari and chrome. For example Orion.

1 Like

Perhaps, but don't hold your breath. :slight_smile:

Knowing your drive and expertise I almost dare too :sweat_smile:

1 Like

I got this running, even managed to fix the "Can't convert types" error, even though I didn't even know which file to change it in (somehow found the "Action.scpt" file and changed the first instance of it in there, seems to have worked).

But I'd really love for this to open a new window instead of a new tab in case the website is not already open. Is it possible to do that?

I assume it's possible, but I ain't gonna do it. :grinning:

1 Like

I'm having an issue where the plugin doesn't seem to activate the right tab.
Scenerio:

I have 2 chrome tabs open side by side. Left tab is URL#1, Right Tab is URL #2. I have the plugin set to "Match Start" and put in URL#1 in the field. When I run the macro URL #2 is chosen, even though URL#2 is totally different from URL#1.

Any ideas?

Nyet.

And no one is likely to, unless you provide an actual test case for folks to try out.

1 Like

Hello Dan,
I am a Keyboard Maestro novice who just got started a week ago. I was amazed to find that you had developed exactly the kind of macro I was hoping existed. And you did that almost 6 years ago! Thank you so much.

I did however run into a small glitch when I ran it. It put out the message
" Error: Can't convert types" in a separate window.

When Safari wasn't even running, it started Safari and then failed with the error. With Safari running in the background, I got this error right away.

I am not a programmer and have no clue as to how Javascripts (or other scripts) work. Am I doing something wrong? Is there any more information I can provide you to help figure out why it is failing? I hope you can help me.

Pathy

Hello John_C
Happy New Year!
I am Pathy, a KM newbie. I messaged Dan about the "Can't convert types" error with Safari but I guess he's not around. I then noticed your fix(?) for this problem in Jun 2020.
Did you by chance attach the wrong macro (Prompt with List) instead of the one with your fix (v1.1a)?

Pathy

Use the 'at' symbol. This will flag Dan directly.

Like This. @DanThomas

LOL, sorry you're getting the runaround here, but v1.1a was uploaded by @John_C . John - care to comment?

Hi Dan,
I tried to download John's v1.1a but wound up with a totally different macro instead. I asked John if he had accidentally uploaded something else by mistake but haven't heard back from him yet.

In the meantime, I found

MACRO: Activate, Reload, or Open Browser Tab, v3.1 by _jimsIt works very similarly and I have started using it.

Pathy

1 Like