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

I have the same error on Safari 10.1
Its still working ok on Safari 10.0.3

Has anyone solved this “Can’t convert types” error? I’d really miss this Plugin, it worked great when it worked.

Also, is it limited to 10 or does it continue with the newer versions of Safari.


There is another pretty easy way to reload Safari tabs

You just need to specify a tab position 1,2,3...

The script will refresh a specified tab in the background

Hey Kirill,

You can also do something like this.

This script reloads every tab in the front Safari window, but it can easily be adapted to work with a specific tab in a specific window.


# Auth: Christopher Stone
# dCre: 2011/08/09 20:33
# dMod: 2015/11/14 16:46
# Appl: Safari
# Task: Reload Every Tab in front window.
# Libs: ELb
# Osax: None
# Tags: @Applescript, @Safari, @Reload, @Tabs, @Front, @Window

tell application "Safari"
   set tabList to tabs of front window
   repeat with theTab in tabList
      tell theTab to do JavaScript "location.reload(true)"
   end repeat
end tell

1 Like

Agreed. Still works for Chrome, but not safari. And I'm on 12.0. A huge bummer, as I loved this macro!

Great plugin/macro! Unfortunately, I'm having the same problem with this, a simpler version I tried to make for myself, as well as @JMichaelTX 's from here.

In all of these, the correct tab is selected but the chrome window is not set to frontmost. In other words, if I have only one chrome window open everything works perfectly but if I have 2 chrome windows open and the opposite window is currently focused, "AXRaise" is not working at all to switch to the window with the desired tab.

Mac version: 10.14
Chrome version: 72.0.3626.121
KM Version: 8.2.4

EDIT: taking a closer look the following Applescript works fine for me with "Safari", but not at all with "Google Chrome"

tell application "System Events"
	tell application process "Google Chrome"
		tell (window 2) to perform action "AXRaise"
	end tell
end tell

Re the "can't convert types" error that stops this working with safari: I think I have fixed it, but I don't really understand the fix :slight_smile:
Replacing the line:
var result = [{document: null}]});
var result =
removes the error. It may have been required on an older version of safari? I've tested it with multiple safari windows, blank tabs, etc, and it seems robust.

I've attached my patched version here.

MACRO - Open or Refresh a URL in a Tab (Sub-Macro).v1.1a.kmmacros (1.7 KB)


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.,

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.,
1 Like

Upon further testing today with Safari v16.0 (18614., 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